\u7b2c 2 \u90e8\u5206\uff1a\u6dfb\u52a0\u8fdc\u7a0b\u5b58\u50a8\u5e93\u7684 GPG \u5bc6\u94a5<\/strong><\/span><\/div>\nLinux \u5b58\u50a8\u5e93\u5185\u7f6e\u4e86\u57fa\u4e8e GPG \u5bc6\u94a5\u7684\u5b89\u5168\u673a\u5236\u3002\u6bcf\u4e2a\u5b58\u50a8\u5e93\u90fd\u5c06\u5176 GPG \u516c\u94a5\u6dfb\u52a0\u5230\u4f60\u7684\u7cfb\u7edf\u4fe1\u4efb\u5bc6\u94a5\u4e2d\u3002\u6765\u81ea\u5b58\u50a8\u5e93\u7684\u5305\u7531\u8fd9\u4e2a GPG \u5bc6\u94a5\u201c\u7b7e\u540dsigned\u201d\uff0c\u5e76\u4e14\u901a\u8fc7\u8fd9\u4efd\u5b58\u50a8\u7684\u516c\u94a5\uff0c\u7cfb\u7edf\u80fd\u591f\u9a8c\u8bc1\u8f6f\u4ef6\u5305\u6b63\u662f\u6765\u81ea\u8fd9\u4e2a\u5b58\u50a8\u5e93\u3002<\/p>\n
\u5982\u679c\u00a0\u200b\u200b\u5bc6\u94a5\u4e4b\u95f4\u4e0d\u5339\u914d\uff0c\u4f60\u7684\u7cfb\u7edf\u4f1a\u53d1\u51fa\u63d0\u9192\u200b\u200b\uff0c\u800c\u4e0d\u4f1a\u7ee7\u7eed\u4ece\u8be5\u5b58\u50a8\u5e93\u5b89\u88c5\u6216\u8005\u66f4\u65b0\u8f6f\u4ef6\u5305\u3002<\/p>\n
\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u4e00\u5207\u90fd\u5f88\u987a\u5229\u3002\u4e0b\u4e00\u6b65\u662f\u5c06\u5916\u90e8\u5b58\u50a8\u5e93\u7684 GPG \u516c\u94a5\u6dfb\u52a0\u5230\u4f60\u7684 Linux \u7cfb\u7edf\uff0c\u4ee5\u4fbf\u5b83\u80fd\u63a5\u6536\u6765\u81ea\u8be5\u5b58\u50a8\u5e93\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n
curl -sS https:\/\/dl.yarnpkg.com\/debian\/pubkey.gpg | sudo apt-key add -<\/pre>\n\u5728\u4e0a\u9762\u7684\u547d\u4ee4\u4e2d\uff0c\u4f60\u4f7f\u7528 \u200b\u200bcurl\u200b\u200b \u4ece\u6307\u5b9a\u7684 URL \u4e0b\u8f7d GPG \u5bc6\u94a5\u3002\u9009\u9879 \u200b\u200b-sS\u200b\u200b \u80fd\u591f\u8ba9\u4f60\u4e0d\u770b\u591a\u4f59\u7684\u8f93\u51fa\uff08\u9759\u9ed8\u6a21\u5f0f\uff09\uff0c\u4f46\u4f1a\u663e\u793a\u9519\u8bef\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\u3002\u6700\u540e\u4e00\u4e2a \u200b\u200b-\u200b\u200b \u544a\u8bc9 \u200b\u200bapt-key\u200b\u200b \u4f7f\u7528\u6807\u51c6\u8f93\u5165stdin\u800c\u4e0d\u662f\u6587\u4ef6\uff08\u5728\u672c\u4f8b\u4e2d\u662f \u200b\u200bcurl\u200b\u200b \u547d\u4ee4\u7684\u8f93\u51fa\uff09\u3002<\/p>\n
\u200b\u200bapt-key add\u200b\u200b\u00a0\u547d\u4ee4\u5df2\u7ecf\u5c06\u4e0b\u8f7d\u7684\u5bc6\u94a5\u6dfb\u52a0\u5230\u7cfb\u7edf\u4e2d\u3002<\/p>\n
\u4f60\u53ef\u4ee5\u901a\u8fc7\u00a0\u200b\u200bapt-key list\u200b\u200b\u00a0\u547d\u4ee4\u67e5\u770b\u7cfb\u7edf\u4e2d\u5404\u79cd\u5b58\u50a8\u5e93\u6dfb\u52a0\u7684 GPG \u5bc6\u94a5\u3002<\/p>\n
<\/p>\n
List GPG keys<\/em><\/p>\n\u8fd9\u662f\u5c06 GPG \u5bc6\u94a5\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u4e00\u79cd\u65b9\u6cd5\u3002\u4f60\u4f1a\u770b\u5230\u4e00\u4e9b\u5176\u5b83\u7684\u547d\u4ee4\uff0c\u770b\u8d77\u6765\u7565\u6709\u4e0d\u540c\uff0c\u4f46\u6548\u679c\u4e00\u6837\uff0c\u90fd\u662f\u5c06\u5b58\u50a8\u5e93\u7684\u516c\u94a5\u6dfb\u52a0\u5230\u4f60\u7684\u7cfb\u7edf\u91cc\u9762\u3002<\/p>\n
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9<\/pre>\n\u4f60\u4f1a\u6ce8\u610f\u5230 \u200b\u200bapt-key\u200b\u200b \u5df2\u88ab\u5f03\u7528\u7684\u8b66\u544a\u3002\u5728 Ubuntu 22.04 \u4e4b\u524d\uff0c\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528 \u200b\u200bapt-key\u200b\u200b \u547d\u4ee4\uff0c\u4f46\u5b83\u6700\u7ec8\u4f1a\u88ab\u5220\u9664\u3002\u73b0\u5728\u4e0d\u9700\u8981\u675e\u4eba\u5fe7\u5929\u3002<\/p>\n
\u7b2c 3 \u90e8\u5206\uff1a\u5c06\u5916\u90e8\u5b58\u50a8\u5e93\u6dfb\u52a0\u5230\u6e90\u5217\u8868<\/strong><\/span><\/div>\n\u4e0b\u4e2a\u547d\u4ee4\u662f\u5728\u7cfb\u7edf\u7684\u6e90\u5217\u8868\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u65b0\u6761\u76ee\u3002\u8fd9\u6837\uff0c\u4f60\u7684\u7cfb\u7edf\u5c31\u4f1a\u77e5\u9053\u5b83\u5f97\u68c0\u67e5\u8be5\u5b58\u50a8\u5e93\u4e2d\u7684\u5305\u548c\u66f4\u65b0\u3002<\/p>\n
sudo sh -c 'echo \"deb https:\/\/dl.yarnpkg.com\/debian\/ stable main\" >> \/etc\/apt\/sources.list.d\/yarn.list'<\/pre>\n\u6709\u4e00\u4e2a\u6587\u4ef6 \u200b\u200b\/etc\/apt\/sources.list\u200b\u200b \u5305\u542b Ubuntu \u5b58\u50a8\u5e93\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u6700\u597d\u4e0d\u8981\u968f\u4fbf\u52a8\u8fd9\u4e2a\u6587\u4ef6\u3002\u6240\u6709\u65b0\u589e\u7684\u5b58\u50a8\u5e93\u90fd\u5e94\u653e\u5728 \u200b\u200b\/etc\/apt\/sources.list.d\u200b\u200b \u76ee\u5f55\u4e2d\u76f8\u5e94\u7684\u6587\u4ef6\u91cc\uff08\u7ea6\u5b9a\u4ee5 \u200b\u200b.list\u200b\u200b \u7ed3\u5c3e\uff09\u3002<\/p>\n
<\/p>\n
External repository should have their own sources list file in the \/etc\/apt\/sources.list.d directory<\/em><\/p>\n\u8fd9\u4f7f\u5f97\u5305\u7ba1\u7406\u53d8\u5f97\u66f4\u5bb9\u6613\u3002\u5982\u679c\u4f60\u8981\u4ece\u7cfb\u7edf\u4e2d\u5220\u9664\u4e00\u4e2a\u5b58\u50a8\u5e93\uff0c\u53ea\u9700\u5220\u9664\u76f8\u5e94\u7684\u6e90\u6587\u4ef6\u5373\u53ef\u3002\u65e0\u9700\u4fee\u6539\u4e3b\u00a0\u200b\u200bsources.list\u200b\u200b\u00a0\u6587\u4ef6\u3002<\/p>\n
\u8ba9\u6211\u4eec\u518d\u4ed4\u7ec6\u5730\u770b\u4e00\u4e0b\u8fd9\u884c\u547d\u4ee4\u3002<\/p>\n
sudo sh -c 'echo \"deb https:\/\/dl.yarnpkg.com\/debian\/ stable main\" >> \/etc\/apt\/sources.list.d\/yarn.list'<\/pre>\n\u4f7f\u7528 \u200b\u200bsh\u200b\u200b \u53ef\u4ee5\u5728\u4e00\u4e2a\u65b0\u7684 shell \u8fdb\u7a0b\u4e2d\u8fd0\u884c\u547d\u4ee4\uff0c\u800c\u4e0d\u662f \u200b\u200b\u5b50 shell\u200b\u200b\u3002 \u200b\u200b-c\u200b\u200b \u9009\u9879\u544a\u8bc9 \u200b\u200bsh\u200b\u200b \u547d\u4ee4\u4ece\u53c2\u6570\u800c\u4e0d\u662f\u6807\u51c6\u8f93\u5165\u8bfb\u53d6\u547d\u4ee4\u3002\u7136\u540e\u5b83\u8fd0\u884c \u200b\u200becho\u200b\u200b \u547d\u4ee4\uff0c\u4e5f\u5c31\u662f\u628a \u200b\u200bdeb https:\/\/dl.yarnpkg.com\/debian\/ stable main\u200b\u200b \u8fd9\u4e00\u884c\u6dfb\u52a0\u5230 \u200b\u200b\/etc\/apt\/sources.list.d\/yarn.list\u200b\u200b \u6587\u4ef6\uff08\u4f1a\u521b\u5efa\u8be5\u6587\u4ef6\uff09\u3002<\/p>\n
\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u5404\u79cd\u65b9\u6cd5\u5728\u6307\u5b9a\u76ee\u5f55\u4e2d\u521b\u5efa\u00a0\u200b\u200b.list\u200b\u200b \u6587\u4ef6\u5e76\u5728\u5176\u4e2d\u6dfb\u52a0\u5305\u542b\u5b58\u50a8\u5e93\u8be6\u7ec6\u4fe1\u606f\u7684\u6570\u636e\u884c\u3002\u4f60\u4e5f\u53ef\u4ee5\u50cf\u8fd9\u6837\u4f7f\u7528\uff1a<\/p>\n
echo \"deb https:\/\/dl.yarnpkg.com\/debian\/ stable main\" | sudo tee \/etc\/apt\/sources.list.d\/yarn.list<\/pre>\n\u660e\u767d\u4e86\u5427\uff1f<\/p>\n
\u7b2c 4 \u90e8\u5206\uff1a\u4ece\u65b0\u6dfb\u52a0\u7684\u5b58\u50a8\u5e93\u5b89\u88c5\u5e94\u7528\u7a0b\u5e8f<\/strong><\/span><\/div>\n\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u4f60\u5df2\u7ecf\u5c06\u5b58\u50a8\u5e93\u7684 GPG \u5bc6\u94a5\u548c\u5b58\u50a8\u5e93\u7684 URL \u6dfb\u52a0\u5230\u7cfb\u7edf\u4e2d\u3002<\/p>\n
\u4f46\u662f\u7cfb\u7edf\u4ecd\u7136\u4e0d\u6653\u5f97\u8fd9\u4e2a\u65b0\u5b58\u50a8\u5e93\u4e2d\u6709\u54ea\u4e9b\u53ef\u7528\u7684\u5305\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u4f60\u9700\u8981\u5148\u4f7f\u7528\u4e0b\u9762\u8fd9\u4e2a\u547d\u4ee4\u66f4\u65b0\u5305\u5143\u6570\u636e\u7684\u672c\u5730\u7f13\u5b58\uff1a<\/p>\n
sudo apt update<\/pre>\n\u8fd9\u65f6\u4f60\u7684\u7cfb\u7edf\u5c31\u5df2\u7ecf\u77e5\u9053\u65b0\u589e\u5b58\u50a8\u5e93\u4e2d\u53ef\u7528\u8f6f\u4ef6\u5305\u7684\u4fe1\u606f\uff0c\u73b0\u5728\u53ef\u4ee5\u8bd5\u8bd5\u5b89\u88c5\u8f6f\u4ef6\u5305\uff1a<\/p>\n
sudo apt install yarn<\/pre>\n\u4e3a\u4e86\u8282\u7701\u65f6\u95f4\uff0c\u4f60\u53ef\u4ee5\u5728 \u200b\u200b\u540c\u4e00\u884c\u6328\u7740\u8fd0\u884c\u8fd9\u4e24\u4e2a\u547d\u4ee4\u200b\u200be\u3002<\/p>\n
sudo apt update && sudo apt install yarn<\/pre>\n\u200b\u200b&&\u200b\u200b \u53ef\u4ee5\u786e\u4fdd\u7b2c\u4e8c\u4e2a\u547d\u4ee4\u53ea\u4f1a\u5728\u524d\u4e00\u4e2a\u547d\u4ee4\u6ca1\u6709\u4efb\u4f55\u62a5\u9519\u7684\u524d\u63d0\u4e0b\u8fd0\u884c\u3002<\/p>\n
\u6574\u4e2a\u6d41\u7a0b\u5c31\u662f\u8fd9\u6837\u3002<\/p>\n
\u6709\u6ca1\u6709\u8c41\u7136\u5f00\u6717\u5462\uff0c\u8fd8\u662f\u4e00\u8138\u61f5\u903c\uff1f<\/strong><\/span><\/div>\n\u6211\u5df2\u7ecf\u89e3\u91ca\u4e86\u5728 Ubuntu \u4e2d\u4f7f\u7528\u5916\u90e8\u5b58\u50a8\u5e93\u80cc\u540e\u7684\u903b\u8f91\u3002\u5e0c\u671b\u4f60\u73b0\u5728\u80fd\u66f4\u597d\u5730\u7406\u89e3\u5b83\uff0c\u5f53\u7136\u53ef\u80fd\u8fd8\u6709\u5f88\u591a\u7ec6\u8282\u4f1a\u8ba9\u4f60\u56f0\u60d1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u90a3\u7b2c\u4e09\u65b9\u6216\u8005\u5916\u90e8\u5b58\u50a8\u5e93\u5462\uff1f\u4e0d\uff0c\u6211\u8fd9\u91cc\u5e76\u4e0d\u662f\u8981\u8bb2 PPA\u3002 \u65e9\u665a\u4f60\u4f1a\u78b0\u5230\u90a3\u79cd\u81f3\u5c11\u56db\u884c\u7684\u5b89\u88c5\u8bf4\u660e\uff1a\u4f60\u9700\u8981\u5b89\u88c5\u540d\u4e3a\u00a0 […]<\/p>\n","protected":false},"author":323,"featured_media":257474,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-258894","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/258894","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=258894"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/258894\/revisions"}],"predecessor-version":[{"id":259204,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/258894\/revisions\/259204"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/257474"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=258894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=258894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=258894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}