{"id":12583,"date":"2021-11-06T18:38:36","date_gmt":"2021-11-06T18:38:36","guid":{"rendered":"http:\/\/www.max-sperling.bplaced.net\/?p=12583"},"modified":"2024-02-16T10:34:23","modified_gmt":"2024-02-16T10:34:23","slug":"symlink-to-switch-between-sw-versions","status":"publish","type":"post","link":"http:\/\/www.max-sperling.bplaced.net\/?p=12583","title":{"rendered":"Symlink to switch between SW versions"},"content":{"rendered":"<p>I was building Node.js v16 which uses a fork of GYP (meta-build tool written in python). The setup script contains the shebang &#8216;#!\/usr\/bin\/env python3&#8217;. The binary \/usr\/bin\/env executes the first python3 found based on $PATH.<\/p>\n<pre>\r\n\/usr\/bin$ env | grep PATH\r\n...\r\nPATH=\/home\/user\/bin: ... :\/usr\/local\/bin: ... :\/usr\/bin: ...\r\n...\r\n\/usr\/bin$ env python3 --version\r\nPython 3.5\r\n<\/pre>\n<p>But the required python versions are 3.6, 3.7, 3.8, 3.9, or 3.10. The issue with python is that it&#8217;s non backward compatible. Therefore it&#8217;s nice to switch between versions directly on the running system with only redirecting the symlink.<\/p>\n<pre>\r\n\/usr\/bin$ sudo apt install python3.10\r\n...\r\n\/usr\/bin$ ls -l | grep python3\r\n...\r\n... python3 -> python3.5\r\n... python3.5\r\n... python3.10\r\n...\r\n\/usr\/bin$ sudo ln -sfn python3.10 python3\r\n\/usr\/bin$ ls -l | grep python3\r\n...\r\n... python3 -> python3.10\r\n... python3.5\r\n... python3.10\r\n...\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I was building Node.js v16 which uses a fork of GYP (meta-build tool written in python). The setup script contains<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false},"categories":[65],"tags":[],"_links":{"self":[{"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/posts\/12583"}],"collection":[{"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12583"}],"version-history":[{"count":1,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/posts\/12583\/revisions"}],"predecessor-version":[{"id":16791,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=\/wp\/v2\/posts\/12583\/revisions\/16791"}],"wp:attachment":[{"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12583"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.max-sperling.bplaced.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}