{"id":1484,"date":"2023-02-10T17:16:30","date_gmt":"2023-02-10T09:16:30","guid":{"rendered":"http:\/\/175.24.184.226\/?p=1484"},"modified":"2023-02-10T17:26:02","modified_gmt":"2023-02-10T09:26:02","slug":"ubuntu%e7%9a%84apt-get%e6%ba%90%e4%bf%ae%e6%94%b9%e4%b8%8e%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"\/?p=1484","title":{"rendered":"Ubuntu\u7684apt-get\u6e90\u4fee\u6539\u4e0e\u4f7f\u7528\u53ca\u5e38\u7528\u6307\u4ee4"},"content":{"rendered":"<table>\n<tbody>\n<tr>\n<td><strong>\u65b0\u88c5\u7684ubuntu\u3002\u4f7f\u7528apt-get<a href=\"https:\/\/www.linuxcool.com\/\" title=\"\u547d\u4ee4\">\u547d\u4ee4<\/a>\u5b89\u88c5\u8f6f\u4ef6\u65f6\uff0c\u6709\u65f6\u5019\u901f\u5ea6\u6bd4\u8f83\u6162\uff0c\u6709\u65f6\u5019\u4f1a\u5931\u8d25\u3002\u56e0\u6b64\u8003\u8651\u7528\u56fd\u5185\u7684\u955c\u50cf\u6e90\u66f4\u6362\u4e0bapt-get\u7684\u9ed8\u8ba4\u6e90\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><strong>\u4e00\u3001\u4fee\u6539apt-get\u6e90<\/strong><\/h2>\n<pre><code># \u66f4\u65b0\u6e90\nsudo apt-get update\n# \u5907\u4efd\u539f\u6587\u4ef6\nsudo cp \/etc\/apt\/sources.list \/etc\/apt\/sources.list.bak\n# \u7f16\u8f91\u6e90\u5217\u8868\u6587\u4ef6\nsudo vim \/etc\/apt\/sources.list\n# \u5c06\u539f\u6765\u7684\u5217\u8868\u5220\u9664\uff0c\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff08\u6e05\u534e\u5927\u5b66\u955c\u50cf\u6e90\uff09\n\n# start\n# \u9ed8\u8ba4\u6ce8\u91ca\u4e86\u6e90\u7801\u955c\u50cf\u4ee5\u63d0\u9ad8 apt update \u901f\u5ea6\uff0c\u5982\u6709\u9700\u8981\u53ef\u81ea\u884c\u53d6\u6d88\u6ce8\u91ca\ndeb https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ bionic main restricted universe multiverse\n# deb-src https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ bionic main restricted universe multiverse\ndeb https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ bionic-updates main restricted universe multiverse\n# deb-src https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ bionic-updates main restricted universe multiverse\ndeb https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ bionic-backports main restricted universe multiverse\n# deb-src https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ bionic-backports main restricted universe multiverse\ndeb https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ bionic-security main restricted universe multiverse\n# deb-src https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ bionic-security main restricted universe multiverse\n\n# \u9884\u53d1\u5e03\u8f6f\u4ef6\u6e90\uff0c\u4e0d\u5efa\u8bae\u542f\u7528\n# deb https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ bionic-proposed main restricted universe multiverse\n# deb-src https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu\/ bionic-proposed main restricted universe multiverse\n# end\n\n# \u66f4\u65b0\u6e90\nsudo apt-get update\n<\/code><\/pre>\n<h2>\u4e8c\u3001\u51fa\u73b0\u95ee\u9898\uff1a<\/h2>\n<p>\u5728\u6267\u884c<code>sudo apt-get update<\/code>\u540e\u51fa\u73b0\u4ee5\u4e0b\u7684\u95ee\u9898\uff1a<\/p>\n<pre><code>lee@lee-virtual-machine:~\/workspace\/yolov5Pro\/yolov5$ sudo apt-get update\nGet:1 https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic InRelease [242 kB]\nGet:2 https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-updates InRelease [88.7 kB]\nErr:1 https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic InRelease\n  The following signatures couldn&#039;t be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32\nGet:3 https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-backports InRelease [83.3 kB]\nGet:4 https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-security InRelease [88.7 kB]\nErr:2 https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-updates InRelease\n  The following signatures couldn&#039;t be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32\nErr:3 https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-backports InRelease\n  The following signatures couldn&#039;t be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32\nErr:4 https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-security InRelease\n  The following signatures couldn&#039;t be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32\nReading package lists... Done\nW: GPG error: https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic InRelease: The following signatures couldn&#039;t be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32\nE: The repository &#039;https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic InRelease&#039; is not signed.\nN: Updating from such a repository can&#039;t be done securely, and is therefore disabled by default.\nN: See apt-secure(8) manpage for repository creation and user configuration details.\nW: GPG error: https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-updates InRelease: The following signatures couldn&#039;t be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32\nE: The repository &#039;https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-updates InRelease&#039; is not signed.\nN: Updating from such a repository can&#039;t be done securely, and is therefore disabled by default.\nN: See apt-secure(8) manpage for repository creation and user configuration details.\nW: GPG error: https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-backports InRelease: The following signatures couldn&#039;t be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32\nE: The repository &#039;https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-backports InRelease&#039; is not signed.\nN: Updating from such a repository can&#039;t be done securely, and is therefore disabled by default.\nN: See apt-secure(8) manpage for repository creation and user configuration details.\nW: GPG error: https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-security InRelease: The following signatures couldn&#039;t be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32\nE: The repository &#039;https:\/\/mirrors.tuna.tsinghua.edu.cn\/ubuntu bionic-security InRelease&#039; is not signed.\nN: Updating from such a repository can&#039;t be done securely, and is therefore disabled by default.\nN: See apt-secure(8) manpage for repository creation and user configuration details.<\/code><\/pre>\n<h2><strong>\u89e3\u51b3\u529e\u6cd5\uff1a<\/strong><\/h2>\n<p>\u66f4\u6362\u6e90\u4e4b\u540e\u9700\u8981\u6dfb\u52a0<a href=\"https:\/\/so.csdn.net\/so\/search?q=\u516c\u94a5&amp;spm=1001.2101.3001.7020\">\u516c\u94a5<\/a>\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li>\n<p>\u6ce8\u610f\uff1a\u8fd9\u91cc\u7684recv-keys\u5c31\u662f\u62a5\u9519\u4e2d\u7684key\uff0c\u7c98\u8d34\u8fc7\u6765\u5373\u53ef <code>3B4FE6ACC0B21F32<\/code><\/p>\n<\/li>\n<li>\n<pre><code class=\"language-bash\">gpg --keyserver  keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32\ngpg --export --armor 3B4FE6ACC0B21F32 | sudo apt-key add -<\/code><\/pre>\n<\/li>\n<\/ul>\n<pre><code class=\"language-shell\">lee@lee-virtual-machine:~\/workspace\/yolov5Pro\/yolov5$ gpg --keyserver  keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32\ngpg --export --armor 3B4FE6ACC0B21F32 | sudo apt-key add -\ngpg: directory &#039;\/home\/lee\/.gnupg&#039; created\ngpg: keybox &#039;\/home\/lee\/.gnupg\/pubring.kbx&#039; created\ngpg: \/home\/lee\/.gnupg\/trustdb.gpg: trustdb created\ngpg: key 3B4FE6ACC0B21F32: public key &quot;Ubuntu Archive Automatic Signing Key (2012) &lt;ftpmaster@ubuntu.com&gt;&quot; imported\ngpg: Total number processed: 1\ngpg:               imported: 1\nWarning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).\nOK<\/code><\/pre>\n<h2><strong>\u4e09\u3001apt-get\u5e38\u7528<a href=\"https:\/\/www.linuxcool.com\/\" title=\"\u547d\u4ee4\">\u547d\u4ee4<\/a><\/strong><\/h2>\n<p>apt-get\u4f7f\u7528\u4e8edeb\u5305\u7ba1\u7406\u5f0f\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4e3b\u8981\u7528\u4e8e\u81ea\u52a8\u4ece\u4e92\u8054\u7f51\u7684\u8f6f\u4ef6\u4ed3\u5e93\u7167\u4e2d\u641c\u7d22\u3001\u5b89\u88c5\u3001\u5347\u7ea7\u3001\u5378\u8f7d\u8f6f\u4ef6\u6216\u64cd\u4f5c\u7cfb\u7edf\uff0c\u9700\u8981root\u6743\u9650<\/p>\n<pre><code>sudo apt-get update \u66f4\u65b0\u6e90\n\nsudo apt-get install package \u5b89\u88c5\u5305\n\nsudo apt-get remove package \u5220\u9664\u5305\n\nsudo apt-cache search package \u641c\u7d22\u8f6f\u4ef6\u5305\n\nsudo apt-cache show package \u83b7\u53d6\u5305\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u5982\u8bf4\u660e\u3001\u5927\u5c0f\u3001\u7248\u672c\u7b49\n\nsudo apt-get install package --reinstall \u91cd\u65b0\u5b89\u88c5\u5305\n\nsudo apt-get -f install \u4fee\u590d\u5b89\u88c5\n\nsudo apt-get remove package --purge \u5220\u9664\u5305\uff0c\u5305\u62ec\u914d\u7f6e\u6587\u4ef6\u7b49\n\nsudo apt-get build-dep package \u5b89\u88c5\u76f8\u5173\u7684\u7f16\u8bd1\u73af\u5883\n\nsudo apt-get upgrade \u66f4\u65b0\u5df2\u5b89\u88c5\u7684\u5305\n\nsudo apt-get dist-upgrade \u5347\u7ea7\u7cfb\u7edf\n\nsudo apt-cache depends package \u4e86\u89e3\u4f7f\u7528\u8be5\u5305\u4f9d\u8d56\u90a3\u4e9b\u5305\n\nsudo apt-cache rdepends package \u67e5\u770b\u8be5\u5305\u88ab\u54ea\u4e9b\u5305\u4f9d\u8d56\n\nsudo apt-get source package \u4e0b\u8f7d\u8be5\u5305\u7684\u6e90\u4ee3\u7801\n\nsudo apt-get clean &amp;&amp; sudo apt-get autoclean \u6e05\u7406\u65e0\u7528\u7684\u5305\n\nsudo apt-get check \u68c0\u67e5\u662f\u5426\u6709\u635f\u574f\u7684\u4f9d\u8d56<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u65b0\u88c5\u7684ubuntu\u3002\u4f7f\u7528apt-get\u547d\u4ee4\u5b89\u88c5\u8f6f\u4ef6\u65f6\uff0c\u6709\u65f6\u5019\u901f\u5ea6\u6bd4\u8f83\u6162\uff0c\u6709\u65f6\u5019\u4f1a\u5931\u8d25\u3002\u56e0\u6b64\u8003\u8651\u7528\u56fd\u5185\u7684\u955c\u50cf\u6e90\u66f4\u6362\u4e0bapt-get\u7684\u9ed8\u8ba4\u6e90   \u2026 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[14],"tags":[],"_links":{"self":[{"href":"\/index.php?rest_route=\/wp\/v2\/posts\/1484"}],"collection":[{"href":"\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1484"}],"version-history":[{"count":3,"href":"\/index.php?rest_route=\/wp\/v2\/posts\/1484\/revisions"}],"predecessor-version":[{"id":1487,"href":"\/index.php?rest_route=\/wp\/v2\/posts\/1484\/revisions\/1487"}],"wp:attachment":[{"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1484"},{"taxonomy":"post_tag","embeddable":true,"href":"\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}