{"id":27134,"date":"2023-07-06T17:22:41","date_gmt":"2023-07-31T19:55:47","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/"},"modified":"2025-08-12T00:58:38","modified_gmt":"2025-08-11T16:58:38","slug":"%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/","title":{"rendered":"\u5728Ubuntu\u4e0a\u5b89\u88c5Swift"},"content":{"rendered":"<p>\u6211\u5c1d\u8bd5\u5728Ubuntu 16.04\u4e0a\u5b89\u88c5Swift 3.1.1\u3002<\/p>\n<pre class=\"post-pre\"><code>$ cat \/etc\/lsb-release\r\nDISTRIB_ID=Ubuntu\r\nDISTRIB_RELEASE=16.04\r\nDISTRIB_CODENAME=xenial\r\nDISTRIB_DESCRIPTION=\"Ubuntu 16.04.2 LTS\"\r\n$ sudo apt-get install -y clang libicu-dev\r\n$ curl -OR https:\/\/swift.org\/builds\/swift-3.1.1-release\/ubuntu1604\/swift-3.1.1-RELEASE\/swift-3.1.1-RELEASE-ubuntu16.04.tar.gz\r\n$ curl -OR https:\/\/swift.org\/builds\/swift-3.1.1-release\/ubuntu1604\/swift-3.1.1-RELEASE\/swift-3.1.1-RELEASE-ubuntu16.04.tar.gz.sig\r\n$ ls -l swift-3.1.1-RELEASE-ubuntu16.04.tar.gz*\r\n-rw-rw-r-- 1 glire glire 122709317 Apr 22 10:50 swift-3.1.1-RELEASE-ubuntu16.04.tar.gz\r\n-rw-rw-r-- 1 glire glire       819 Apr 22 10:50 swift-3.1.1-RELEASE-ubuntu16.04.tar.gz.sig\r\n$ wget -q -O - https:\/\/swift.org\/keys\/all-keys.asc | gpg --import -\r\n$ gpg --keyserver hkp:\/\/pool.sks-keyservers.net --refresh-keys Swift\r\n$ gpg --verify swift-3.1.1-RELEASE-ubuntu16.04.tar.gz.sig\r\n$ sudo chmod o+rwx \/opt\r\n$ mv -i swift-3.1.1-RELEASE-ubuntu16.04.tar.gz \/opt\/\r\n$ cd \/opt\/\r\n$ tar xvfz swift-3.1.1-RELEASE-ubuntu16.04.tar.gz\r\n$ ls -l\r\ntotal 119840\r\ndrwxrwxr-x 3 glire glire      4096 May 30 11:22 swift-3.1.1-RELEASE-ubuntu16.04\r\n-rw-rw-r-- 1 glire glire 122709317 Apr 22 10:50 swift-3.1.1-RELEASE-ubuntu16.04.tar.gz\r\n$ rm -f swift-3.1.1-RELEASE-ubuntu16.04.tar.gz\r\n$ sudo chmod o-w \/opt \r\n$ export PATH=\/opt\/swift-3.1.1-RELEASE-ubuntu16.04\/usr\/bin:$PATH\r\n$ which swift\r\n\/opt\/swift-3.1.1-RELEASE-ubuntu16.04\/usr\/bin\/swift\r\n$ swift --version\r\nSwift version 3.1.1 (swift-3.1.1-RELEASE)\r\nTarget: x86_64-unknown-linux-gnu\r\n$ swift\r\nWelcome to Swift version 3.1.1 (swift-3.1.1-RELEASE). Type :help for assistance.\r\n  1&gt; ^D\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u5c1d\u8bd5\u5728Ubuntu 16.04\u4e0a\u5b89\u88c5Swift 3.1.1\u3002 $ cat \/etc\/lsb-release  [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-27134","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728Ubuntu\u4e0a\u5b89\u88c5Swift - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5Swift\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u5b89\u88c5swift\u3002-4\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728Ubuntu\u4e0a\u5b89\u88c5Swift\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5Swift\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u5b89\u88c5swift\u3002-4\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-31T19:55:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-11T16:58:38+00:00\" \/>\n<meta name=\"author\" content=\"\u97f5, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u97f5, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/\",\"name\":\"\u5728Ubuntu\u4e0a\u5b89\u88c5Swift - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-07-31T19:55:47+00:00\",\"dateModified\":\"2025-08-11T16:58:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\"},\"description\":\"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5Swift\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728Ubuntu\u4e0a\u5b89\u88c5Swift\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\",\"name\":\"\u97f5, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"caption\":\"\u97f5, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728Ubuntu\u4e0a\u5b89\u88c5Swift - Blog - Silicon Cloud","description":"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5Swift\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u5b89\u88c5swift\u3002-4\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728Ubuntu\u4e0a\u5b89\u88c5Swift","og_description":"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5Swift\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728ubuntu\u4e0a\u5b89\u88c5swift\u3002-4\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-07-31T19:55:47+00:00","article_modified_time":"2025-08-11T16:58:38+00:00","author":"\u97f5, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u97f5, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/","name":"\u5728Ubuntu\u4e0a\u5b89\u88c5Swift - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-07-31T19:55:47+00:00","dateModified":"2025-08-11T16:58:38+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e"},"description":"\u5173\u4e8e\u5728Ubuntu\u4e0a\u5b89\u88c5Swift\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728Ubuntu\u4e0a\u5b89\u88c5Swift"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e","name":"\u97f5, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","caption":"\u97f5, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85swift%e3%80%82-4\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/27134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=27134"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/27134\/revisions"}],"predecessor-version":[{"id":56217,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/27134\/revisions\/56217"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=27134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=27134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=27134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}