{"id":9097,"date":"2022-01-15T12:52:52","date_gmt":"2022-01-15T12:52:52","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=9097"},"modified":"2022-01-15T13:52:36","modified_gmt":"2022-01-15T13:52:36","slug":"setting-up-swift-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/setting-up-swift-on-ubuntu-20-04\/","title":{"rendered":"Setting up swift on Ubuntu 20.04"},"content":{"rendered":"<p>This is an update to <a href=\"http:\/\/putridparrot.com\/blog\/setting-up-swift-on-ubuntu-18-04\/\" rel=\"noopener\" target=\"_blank\">Setting up swift on Ubuntu 18.04<\/a> &#8211; installing Swift on Ubuntu 20.04.<\/p>\n<p><em>Check out <a href=\"https:\/\/www.swift.org\/download\/\" rel=\"noopener\" target=\"_blank\">Downloads<\/a> for the current info. from swift.org.<\/em><\/p>\n<ul>\n<li>We need to install dependencies, so start with\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\napt-get install binutils git gnupg2 libc6-dev libcurl4 libedit2 libgcc-9-dev libpython2.7 libsqlite3-0 libstdc++-9-dev libxml2 libz3-dev pkg-config tzdata uuid-dev zlib1g-dev\r\n<\/pre>\n<\/li>\n<li>Next we need to download the tar for the version of Swift you&#8217;re targeting, mine&#8217;s Swift 5.5.2\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nwget https:\/\/download.swift.org\/swift-5.5.2-release\/ubuntu2004\/swift-5.5.2-RELEASE\/swift-5.5.2-RELEASE-ubuntu20.04.tar.gz\r\n<\/pre>\n<\/li>\n<\/ul>\n<p>Next up we should verify this download<\/p>\n<ul>\n<li>First download the signature using\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nwget https:\/\/swift.org\/builds\/swift-5.5.2-release\/ubuntu2004\/swift-5.5.2-RELEASE\/swift-5.5.2-RELEASE-ubuntu20.04.tar.gz.sig\r\n<\/pre>\n<\/li>\n<li>Now import the key\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nwget -q -O - https:\/\/swift.org\/keys\/all-keys.asc | gpg --import -\r\n<\/pre>\n<\/li>\n<li>Now run the following\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ngpg --keyserver hkp:\/\/keyserver.ubuntu.com --refresh-keys Swift\r\ngpg --verify swift-5.5.2-RELEASE-ubuntu20.04.tar.gz.sig\r\n<\/pre>\n<\/li>\n<\/ul>\n<p>Assuming everything&#8217;s verified we now want to extract the download into our preferred location &#8211; in my case I am just creating a folder name <em>~\/Swift<\/em> and extracting the tar to this location, running the following from this location<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ntar xzf swift-5.5.2-RELEASE-ubuntu20.04.tar.gz\r\n<\/pre>\n<p>Finally let&#8217;s update the path &#8211; I&#8217;ve added this to the last line of my .bashrc<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nexport PATH=~\/Swift\/swift-5.5.2-RELEASE-ubuntu20.04\/usr\/bin:&quot;${PATH}&quot;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is an update to Setting up swift on Ubuntu 18.04 &#8211; installing Swift on Ubuntu 20.04. Check out Downloads for the current info. from swift.org. We need to install dependencies, so start with apt-get install binutils git gnupg2 libc6-dev libcurl4 libedit2 libgcc-9-dev libpython2.7 libsqlite3-0 libstdc++-9-dev libxml2 libz3-dev pkg-config tzdata uuid-dev zlib1g-dev Next we need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[286,140],"tags":[],"class_list":["post-9097","post","type-post","status-publish","format-standard","hentry","category-swift","category-ubuntu"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=9097"}],"version-history":[{"count":3,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9097\/revisions"}],"predecessor-version":[{"id":9100,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/9097\/revisions\/9100"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=9097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=9097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=9097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}