{"id":5515,"date":"2023-05-19T15:51:03","date_gmt":"2023-05-19T07:51:03","guid":{"rendered":"https:\/\/app.applebyme.cn\/cloud\/?p=5515"},"modified":"2023-05-19T15:51:03","modified_gmt":"2023-05-19T07:51:03","slug":"dpkg%e6%89%93%e5%8c%85deb%e6%98%af%e6%80%8e%e4%b9%88%e6%93%8d%e4%bd%9c%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/app.applebyme.cn\/cloud\/exekaifa\/5515.html","title":{"rendered":"dpkg\u6253\u5305deb\u662f\u600e\u4e48\u64cd\u4f5c\u7684\uff1f"},"content":{"rendered":"<p>dpkg\u662fDebian\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u6b3e\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u80fd\u591f\u5e2e\u52a9\u7528\u6237\u5b89\u88c5\u3001\u5347\u7ea7\u3001\u5378\u8f7d\u548c\u7ef4\u62a4\u8f6f\u4ef6\u5305\u3002\u800c\u6253\u5305deb\u662fdpkg\u7684\u4e00\u4e2a\u91cd\u8981\u529f\u80fd\uff0c\u5b83\u5141\u8bb8\u7528\u6237\u5c06\u81ea\u5df1\u7f16\u5199\u7684\u8f6f\u4ef6\u6253\u5305\u6210\u4e00\u4e2adeb\u8f6f\u4ef6\u5305\uff0c\u65b9\u4fbf\u5728Debian\u7cfb\u7edf\u4e2d\u8fdb\u884c\u5b89\u88c5\u548c\u5378\u8f7d\u3002<\/p>\n<p>deb\u8f6f\u4ef6\u5305\u662fDebian\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u79cd\u6807\u51c6\u8f6f\u4ef6\u5305\u683c\u5f0f\uff0c\u5b83\u5305\u542b\u4e86\u8f6f\u4ef6\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u6587\u6863\u3001\u4f9d\u8d56\u5173\u7cfb\u7b49\u4fe1\u606f\u3002\u6253\u5305deb\u7684\u8fc7\u7a0b\u53ef\u4ee5\u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u521b\u5efa\u8f6f\u4ef6\u5305\u76ee\u5f55\u7ed3\u6784<\/p>\n<p>\u5728\u6253\u5305deb\u4e4b\u524d\uff0c\u9700\u8981\u5148\u521b\u5efa\u4e00\u4e2a\u8f6f\u4ef6\u5305\u76ee\u5f55\u7ed3\u6784\uff0c\u5b83\u5305\u542b\u4e86\u8f6f\u4ef6\u5305\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55\u3002\u76ee\u5f55\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>mypackage\/<\/p>\n<p>\u251c\u2500\u2500 DEBIAN\/<\/p>\n<p>\u2502   \u251c\u2500\u2500 control<\/p>\n<p>\u2502   \u2514\u2500\u2500 postinst<\/p>\n<p>\u251c\u2500\u2500 usr\/<\/p>\n<p>\u2502   \u251c\u2500\u2500 bin\/<\/p>\n<p>\u2502   \u2514\u2500\u2500 share\/<\/p>\n<p>\u2514\u2500\u2500 etc\/<\/p>\n<p>    \u2514\u2500\u2500 mypackage\/<\/p>\n<p>        \u2514\u2500\u2500 config<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cDEBIAN\u76ee\u5f55\u662f\u5fc5\u987b\u7684\uff0c\u5b83\u5305\u542b\u4e86\u8f6f\u4ef6\u5305\u7684\u63a7\u5236\u4fe1\u606f\u548c\u5b89\u88c5\u540e\u7684\u540e\u7eed\u5904\u7406\u811a\u672c\u3002usr\u76ee\u5f55\u7528\u4e8e\u5b58\u653e\u8f6f\u4ef6\u5305\u7684\u53ef\u6267\u884c\u6587\u4ef6\u548c\u5171\u4eab\u6587\u4ef6\uff0cetc\u76ee\u5f55\u7528\u4e8e\u5b58\u653e\u8f6f\u4ef6\u5305\u7684\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/21\/14\/08889053321.jpg\" \/><\/figure>\n<\/p>\n<p>2. \u7f16\u5199\u63a7\u5236\u6587\u4ef6<\/p>\n<p>\u63a7\u5236\u6587\u4ef6\u662f\u8f6f\u4ef6\u5305\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u5b83\u5305\u542b\u4e86\u8f6f\u4ef6\u5305\u7684\u57fa\u672c\u4fe1\u606f\u548c\u4f9d\u8d56\u5173\u7cfb\u3002\u63a7\u5236\u6587\u4ef6\u7684\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>Package: mypackage<\/p>\n<p>Version: 1.0<\/p>\n<p>Section: utils<\/p>\n<p>Priority: optional<\/p>\n<p>Architecture: amd64<\/p>\n<p>Depen<a href=\"https:\/\/exe.yimenapp.com\/tool-1332.html\">\u7535\u8111\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1<\/a>ds: libc6 (&gt;= 2.15), libstdc++6 (&gt;= 4.6), libboost-all-dev<\/p>\n<p>Maintainer: John Doe <\/p>\n<p><p>Description: My package description<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cPackage\u8868\u793a\u8f6f\u4ef6\u5305\u7684\u540d\u79f0\uff0cVersion\u8868\u793a\u8f6f\u4ef6\u5305\u7684\u7248\u672c\u53f7\uff0cSection\u8868\u793a\u8f6f\u4ef6\u5305\u6240\u5c5e\u7684\u7c7b\u522b\uff0cPriority\u8868\u793a\u8f6f\u4ef6\u5305\u7684\u4f18\u5148\u7ea7\uff0cArchitecture\u8868\u793a\u8f6f\u4ef6\u5305\u6240\u652f\u6301\u7684\u4f53\u7cfb\u7ed3\u6784\uff0cDepends\u8868\u793a\u8f6f\u4ef6\u5305\u7684\u4f9d\u8d56\u5173\u7cfb\uff0cMaintainer\u8868\u793a\u8f6f\u4ef6\u5305\u7684\u7ef4\u62a4\u8005\uff0cDescript<a href=\"https:\/\/exe.yimenapp.com\/tool-3460.html\">jfx\u76f4\u63a5\u6253\u5305exe<\/a>ion\u8868\u793a\u8f6f\u4ef6\u5305\u7684\u63cf\u8ff0\u4fe1\u606f\u3002<\/p>\n<p>3. \u7f16\u5199\u5b89\u88c5\u540e\u7684\u540e\u7eed\u5904\u7406\u811a\u672c<\/p>\n<p>\u5b89\u88c5\u540e\u7684\u540e\u7eed\u5904\u7406\u811a\u672c\u662f\u8f6f\u4ef6\u5305\u5b89\u88c5\u540e\u81ea\u52a8\u6267\u884c\u7684\u811a\u672c\uff0c\u5b83\u53ef\u4ee5\u5b8c\u6210\u4e00\u4e9b\u5fc5\u8981\u7684\u914d\u7f6e\u6216\u6e05\u7406\u5de5\u4f5c\u3002\u811a\u672c\u7684\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>#!\/bin\/bash<\/p>\n<p>set -e<\/p>\n<p># commands to run after package installation<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cset -e\u8868\u793a\u5982\u679c\u811a\u672c\u4e2d\u4efb\u4f55\u4e00\u4e2a\u547d\u4ee4\u6267\u884c\u5931\u8d25\uff0c\u5219\u6574\u4e2a\u811a\u672c\u5c06\u4f1a\u9000\u51fa\u3002<\/p>\n<p>4. \u5c06\u8f6f\u4ef6\u5305\u76ee\u5f55\u6253\u5305\u6210deb\u8f6f\u4ef6\u5305<\/p>\n<p>\u5c06\u8f6f\u4ef6\u5305\u76ee\u5f55\u6253\u5305\u6210deb\u8f6f\u4ef6\u5305\u7684\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>dpkg-deb &#8211;build mypackage<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cmypackage\u662f\u8f6f\u4ef6\u5305\u76ee\u5f55\u7684\u540d\u79f0\u3002<\/p>\n<p>5. \u5b89\u88c5\u548c\u5378\u8f7d\u8f6f\u4ef6\u5305<\/p>\n<p>\u5b89\u88c5\u8f6f\u4ef6\u5305\u7684\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>sudo dpkg -i mypackage.deb<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cmypackage.deb\u662f\u6253\u5305\u597d\u7684\u8f6f\u4ef6\u5305\u6587\u4ef6\u3002<\/p>\n<p>\u5378\u8f7d\u8f6f\u4ef6\u5305\u7684\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>sudo dpkg -r mypackage<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cmypackage\u662f\u8f6f\u4ef6\u5305\u7684\u540d\u79f0\u3002<\/p>\n<p>\u603b\u4e4b\uff0c\u6253\u5305deb\u662fdpkg\u7684\u4e00\u4e2a\u91cd\u8981\u529f\u80fd\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5c06\u81ea\u5df1\u7f16\u5199\u7684\u8f6f\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u6807\u51c6\u7684deb\u8f6f\u4ef6\u5305\u3002\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u5730\u521b\u5efa\u3001\u5b89\u88c5\u548c\u5378\u8f7d\u81ea\u5df1\u7684\u8f6f\u4ef6\u5305\uff0c\u5e76\u5c06\u5176\u5206\u4eab\u7ed9\u5176\u4ed6Debian\u7cfb\u7edf\u7684\u7528\u6237\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>dpkg\u662fDebian\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u4e00\u6b3e\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u80fd\u591f\u5e2e\u52a9\u7528\u6237\u5b89\u88c5\u3001\u5347\u7ea7\u3001\u5378\u8f7d\u548c\u7ef4\u62a4\u8f6f\u4ef6\u5305\u3002\u800c\u6253\u5305deb\u662fdpkg\u7684\u4e00\u4e2a\u91cd\u8981\u529f\u80fd\uff0c\u5b83\u5141\u8bb8\u7528\u6237\u5c06\u81ea\u5df1\u7f16\u5199\u7684\u8f6f\u4ef6\u6253\u5305\u6210\u4e00\u4e2adeb\u8f6f\u4ef6\u5305\uff0c\u65b9\u4fbf\u5728Deb<\/p>\n","protected":false},"author":24,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[7890,7891,4019,356,3502],"class_list":["post-5515","post","type-post","status-publish","format-standard","hentry","category-exekaifa","tag-exejre","tag-exe","tag-4019","tag-356","tag-3502"],"_links":{"self":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/5515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/comments?post=5515"}],"version-history":[{"count":0,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/posts\/5515\/revisions"}],"wp:attachment":[{"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/media?parent=5515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/categories?post=5515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.applebyme.cn\/cloud\/wp-json\/wp\/v2\/tags?post=5515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}