{"id":351,"date":"2019-10-07T21:01:23","date_gmt":"2019-10-07T13:01:23","guid":{"rendered":"https:\/\/harson.co\/?p=351"},"modified":"2024-06-13T15:30:25","modified_gmt":"2024-06-13T07:30:25","slug":"linux-change-sourses","status":"publish","type":"post","link":"https:\/\/harson.co\/index.php\/2019\/10\/07\/linux-change-sourses\/","title":{"rendered":"Linux Change Sourses"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Ubuntu\u6362\u6e90\u4e4b\u524d<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>cp \/etc\/apt\/sources.list \/etc\/apt\/sources_init.list<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u963f\u91cc\u4e91Ubuntu 18.04\u6e90<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>deb http:\/\/mirrors.aliyun.com\/ubuntu\/ bionic main restricted universe multiverse\n\ndeb http:\/\/mirrors.aliyun.com\/ubuntu\/ bionic-security main restricted universe multiverse\n\ndeb http:\/\/mirrors.aliyun.com\/ubuntu\/ bionic-updates main restricted universe multiverse\n\ndeb http:\/\/mirrors.aliyun.com\/ubuntu\/ bionic-proposed main restricted universe multiverse\n\ndeb http:\/\/mirrors.aliyun.com\/ubuntu\/ bionic-backports main restricted universe multiverse\n\ndeb-src http:\/\/mirrors.aliyun.com\/ubuntu\/ bionic main restricted universe multiverse\n\ndeb-src http:\/\/mirrors.aliyun.com\/ubuntu\/ bionic-security main restricted universe multiverse\n\ndeb-src http:\/\/mirrors.aliyun.com\/ubuntu\/ bionic-updates main restricted universe multiverse\n\ndeb-src http:\/\/mirrors.aliyun.com\/ubuntu\/ bionic-proposed main restricted universe multiverse\n\ndeb-src http:\/\/mirrors.aliyun.com\/ubuntu\/ bionic-backports main restricted universe multiverse<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Ubuntu\u6362\u6e90\u4e4b\u540e<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update  \u66f4\u65b0\u6e90\nsudo apt-get install package \u5b89\u88c5\u5305\nsudo apt-get remove package \u5220\u9664\u5305\nsudo apt-cache search package \u641c\u7d22\u8f6f\u4ef6\u5305\nsudo apt-cache show package  \u83b7\u53d6\u5305\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u5982\u8bf4\u660e\u3001\u5927\u5c0f\u3001\u7248\u672c\u7b49\nsudo apt-get install package --reinstall  \u91cd\u65b0\u5b89\u88c5\u5305\nsudo apt-get -f install  \u4fee\u590d\u5b89\u88c5\nsudo apt-get remove package --purge \u5220\u9664\u5305\uff0c\u5305\u62ec\u914d\u7f6e\u6587\u4ef6\u7b49\nsudo apt-get build-dep package \u5b89\u88c5\u76f8\u5173\u7684\u7f16\u8bd1\u73af\u5883\nsudo apt-get upgrade \u66f4\u65b0\u5df2\u5b89\u88c5\u7684\u5305\nsudo apt-get dist-upgrade \u5347\u7ea7\u7cfb\u7edf\nsudo apt-cache depends package \u4e86\u89e3\u4f7f\u7528\u8be5\u5305\u4f9d\u8d56\u90a3\u4e9b\u5305\nsudo apt-cache rdepends package \u67e5\u770b\u8be5\u5305\u88ab\u54ea\u4e9b\u5305\u4f9d\u8d56\nsudo apt-get source package  \u4e0b\u8f7d\u8be5\u5305\u7684\u6e90\u4ee3\u7801\nsudo apt-get clean &amp;&amp; sudo apt-get autoclean \u6e05\u7406\u65e0\u7528\u7684\u5305\nsudo apt-get check \u68c0\u67e5\u662f\u5426\u6709\u635f\u574f\u7684\u4f9d\u8d56<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">pip\u6362\u6e90<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>pip\u56fd\u5185\u7684\u4e00\u4e9b\u955c\u50cf\n\n\u2003\u2003\u963f\u91cc\u4e91 http:\/\/mirrors.aliyun.com\/pypi\/simple\/ \n\u2003\u2003\u4e2d\u56fd\u79d1\u6280\u5927\u5b66 https:\/\/pypi.mirrors.ustc.edu.cn\/simple\/ \n\u2003\u2003\u8c46\u74e3(douban) http:\/\/pypi.douban.com\/simple\/ \n\u2003\u2003\u6e05\u534e\u5927\u5b66 https:\/\/pypi.tuna.tsinghua.edu.cn\/simple\/ \n\u2003\u2003\u4e2d\u56fd\u79d1\u5b66\u6280\u672f\u5927\u5b66 http:\/\/pypi.mirrors.ustc.edu.cn\/simple\/<\/code><\/pre>\n\n\n\n<p>\u4fee\u6539\u6e90\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<p>\u4e34\u65f6\u4f7f\u7528\uff1a<br>\u53ef\u4ee5\u5728\u4f7f\u7528pip\u7684\u65f6\u5019\u5728\u540e\u9762\u52a0\u4e0a-i\u53c2\u6570\uff0c\u6307\u5b9apip\u6e90<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>eg: pip install scrapy -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/code><\/pre>\n\n\n\n<p>\u6c38\u4e45\u4fee\u6539\uff1a<br>linux:<br>\u4fee\u6539 ~\/.pip\/pip.conf (\u6ca1\u6709\u5c31\u521b\u5efa\u4e00\u4e2a)\uff0c \u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;global]\nindex-url = https:\/\/pypi.tuna.tsinghua.edu.cn\/simple\n<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u9ad8\u6821\u955c\u50cf\u7ad9<\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">\u6e05\u534e\u5927\u5b66<\/h3>\n\n\n\n<p><a href=\"https:\/\/mirrors.tuna.tsinghua.edu.cn\/\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5357\u4eac\u5927\u5b66<\/h3>\n\n\n\n<p><a href=\"https:\/\/mirror.nju.edu.cn\/\">https:\/\/mirror.nju.edu.cn\/<\/a><\/p>\n\n\n\n<p><strong><s>Docker Hub<\/s><\/strong>\uff08\u5df2\u4e0d\u53ef\u7528\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/docker\/daemon.json\n\n{\n   \"registry-mirrors\": &#91;\"https:\/\/docker.nju.edu.cn\/\"]\n}<\/code><\/pre>\n\n\n\n<p><strong>npm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install &#91;packageName] --registry=https:\/\/repo.nju.edu.cn\/repository\/npm\/\nnpm config set registry https:\/\/repo.nju.edu.cn\/repository\/npm\/<\/code><\/pre>\n\n\n\n<p><strong>Pypi<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install -i https:\/\/repo.nju.edu.cn\/repository\/pypi\/simple &#91;packageName]<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e0a\u6d77\u4ea4\u901a\u5927\u5b66<\/h3>\n\n\n\n<p><a href=\"https:\/\/mirror.sjtu.edu.cn\/\">https:\/\/mirror.sjtu.edu.cn\/<\/a><\/p>\n\n\n\n<p><strong><s>Docker Hub<\/s><\/strong>\uff08\u5df2\u4e0d\u53ef\u7528\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/docker\/daemon.json\n{\n  \"registry-mirrors\": &#91;\"https:\/\/docker.mirrors.sjtug.sjtu.edu.cn\"]\n}<\/code><\/pre>\n\n\n\n<p><strong>npm<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install &#91;packageName] --registry=https:\/\/mirrors.sjtug.sjtu.edu.cn\/npm-registry<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu\u6362\u6e90\u4e4b\u524d \u963f\u91cc\u4e91Ubuntu 18.04\u6e90 Ubuntu\u6362\u6e90\u4e4b\u540e pip\u6362\u6e90 \u4fee\u6539\u6e90\u65b9\u6cd5\uff1a \u4e34\u65f6\u4f7f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-351","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/comments?post=351"}],"version-history":[{"count":4,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts\/351\/revisions"}],"predecessor-version":[{"id":686,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts\/351\/revisions\/686"}],"wp:attachment":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/media?parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/categories?post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/tags?post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}