{"id":904,"date":"2019-12-05T13:32:02","date_gmt":"2019-12-05T05:32:02","guid":{"rendered":"http:\/\/www.shuran.cn\/?p=904"},"modified":"2022-09-16T14:52:36","modified_gmt":"2022-09-16T06:52:36","slug":"debian-%e5%ae%89%e8%a3%85docker-ce%e8%ae%b0%e5%bd%95-unable-to-locate-package-docker-ce","status":"publish","type":"post","link":"https:\/\/www.shuran.cn\/?p=904","title":{"rendered":"Debian \/Centos\u5b89\u88c5docker-ce\u8bb0\u5f55  Unable to locate package docker-ce"},"content":{"rendered":"<p><strong>\u5148\u8bf4Debia<\/strong><\/p>\n<p class=\"p1\">:~# apt-get install docker-ce<\/p>\n<p class=\"p1\">Reading package lists... Done<\/p>\n<p class=\"p1\">Building dependency tree<span class=\"Apple-converted-space\">\u00a0 \u00a0 \u00a0 \u00a0<\/span><\/p>\n<p class=\"p1\">Reading state information... Done<\/p>\n<p class=\"p1\">E: Unable to locate package docker-ce<\/p>\n<p>\u4e8e\u662f\u4e4e<\/p>\n<p class=\"p1\">:~# apt update<\/p>\n<p class=\"p1\">:~# apt-get upgrade<\/p>\n<p>\u518d\u5b89\u88c5\uff0c\u95ee\u9898\u4f9d\u65e7\u3002\u3002\u3002<\/p>\n<h3><strong>\u65b9\u6cd5\uff1a<\/strong><\/h3>\n<p>1\u3001\u8ba9apt\u652f\u6301HTTPS<\/p>\n<pre class=\"prettyprint lang-js\">apt-get install \\\r\n    apt-transport-https \\\r\n    ca-certificates \\\r\n    curl \\\r\n    software-properties-common<\/pre>\n<p><span style=\"color: #333333; font-family: PingFangSC, &quot;font-size:16px; background-color: #ffffff;\">2\u3001\u6dfb\u52a0Docker\u7684\u5b98\u65b9\u5bc6\u94a5<\/span><\/p>\n<pre>\u56fd\u5916\r\ncurl -fsSL https:\/\/download.docker.com\/linux\/debian\/gpg | sudo apt-key add -<\/pre>\n<pre class=\"prettyprint lang-js\">\u56fd\u5185\r\ncurl -fsSL https:\/\/mirrors.ustc.edu.cn\/docker-ce\/linux\/debian\/gpg | sudo apt-key add -<\/pre>\n<pre class=\"prettyprint lang-js\">3\u3001\u67e5\u770b\u672c\u673a\u7684\u7cfb\u7edf\u67b6\u6784<\/pre>\n<pre class=\"prettyprint lang-js\">:~# dpkg --print-architecture\r\namd64<\/pre>\n<p>4\u3001\u5199\u5165\u66f4\u65b0\u6e90<\/p>\n<pre>\u56fd\u5916\r\nadd-apt-repository \"deb [arch=amd64] https:\/\/download.docker.com\/linux\/debian $(lsb_release -cs) stable\"<\/pre>\n<pre>\u56fd\u5185\r\nadd-apt-repository \"deb [arch=amd64] https:\/\/mirrors.ustc.edu.cn\/docker-ce\/linux\/debian  $(lsb_release -cs)  stable\"<\/pre>\n<p>&nbsp;<\/p>\n<p>5\u3001\u7136\u540e\u518d\u6765\u6267\u884c\u5b89\u88c5<\/p>\n<pre class=\"prettyprint lang-js\">apt-get update\r\napt-get install docker-ce<\/pre>\n<p>6\u3001\u67e5\u770b\u7248\u672c<\/p>\n<pre class=\"prettyprint lang-js\">docker version<\/pre>\n<p>------------<\/p>\n<p>\u5982\u679c\u5199\u5165\u66f4\u65b0\u6e90\u5199\u9519\u4e86\uff0c\u6539\u8fd9\u4e2a\u6587\u4ef6<\/p>\n<p class=\"p1\">\/etc\/apt\/sources.list<\/p>\n<hr \/>\n<p>\u4e00\u952e\u5b89\u88c5\u811a\u672c<br \/>\n<span class=\"hljs-comment\">#CentOS 6\u7cfb\u7edf<\/span><br \/>\n<span class=\"hljs-attribute\">rpm<\/span> -iUvh http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm<br \/>\nyum update -y<br \/>\nyum -y install docker-io<br \/>\nservice docker start<br \/>\nchkconfig docker <span class=\"hljs-literal\">on<\/span><\/p>\n<p><span class=\"hljs-comment\">#CentOS 7\u3001Debian\u3001Ubuntu\u7cfb\u7edf<\/span><br \/>\ncurl -sSL https:\/\/get.docker.com\/ | sh<br \/>\nsystemctl start docker<br \/>\nsystemctl enable docker<\/p>\n<p><a href=\"http:\/\/www.shuran.cn\/?p=981\">\u8fd9\u91cc\u67e5\u770b\u5982\u4f55\u8bbe\u7f6e\u56fd\u5185docker\u6e90\uff0c\u52a0\u901f\u5b89\u88c5\u4e0b\u8f7d<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u8bf4Debia :~# apt-get install docker-ce Reading package l\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.shuran.cn\/?p=904\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-904","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=904"}],"version-history":[{"count":6,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/904\/revisions"}],"predecessor-version":[{"id":1261,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/904\/revisions\/1261"}],"wp:attachment":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}