{"id":307,"date":"2025-07-02T09:11:38","date_gmt":"2025-07-02T01:11:38","guid":{"rendered":"https:\/\/qkd.koudaipc.com\/?p=307"},"modified":"2026-01-27T09:46:38","modified_gmt":"2026-01-27T01:46:38","slug":"debian%e8%bd%af%e4%bb%b6%e5%8c%85%e5%8f%91%e5%b8%83%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/qkd.koudaipc.com\/en\/2025\/07\/02\/debian%e8%bd%af%e4%bb%b6%e5%8c%85%e5%8f%91%e5%b8%83%e6%8c%87%e5%8d%97\/","title":{"rendered":"Debian\u8f6f\u4ef6\u5305\u53d1\u5e03\u6307\u5357"},"content":{"rendered":"<p>\u5728 Debian \u7cfb\u7edf\u4e2d\u53d1\u5e03\u81ea\u884c\u7f16\u8bd1\u7684\u8f6f\u4ef6\u5305\u9700\u9075\u5faa\u5176\u6253\u5305\u89c4\u8303\uff0c\u6d89\u53ca\u76ee\u5f55\u7ed3\u6784\u3001\u6784\u5efa\u5de5\u5177\u548c\u53d1\u5e03\u6d41\u7a0b\u3002\u4ee5\u4e0b\u662f\u5173\u952e\u6b65\u9aa4\u53ca\u76ee\u5f55\u7ec4\u7ec7\u683c\u5f0f\u7684\u8be6\u7ec6\u8bf4\u660e\uff1a<\/p>\n<hr \/>\n<h3>\ud83d\udce6 \u4e00\u3001Debian \u8f6f\u4ef6\u5305\u57fa\u672c\u7ed3\u6784<\/h3>\n<p>Debian \u8f6f\u4ef6\u5305\uff08&lt;code&gt;.deb&lt;\/code&gt;\uff09\u672c\u8d28\u662f &lt;code&gt;ar&lt;\/code&gt; \u683c\u5f0f\u7684\u5f52\u6863\u6587\u4ef6\uff0c\u5305\u542b\u4e09\u4e2a\u6838\u5fc3\u90e8\u5206\uff1a<\/p>\n<ol>\n<li><strong>&lt;code&gt;debian-binary&lt;\/code&gt;<\/strong><br \/>\n\u4ec5\u5305\u542b\u7248\u672c\u53f7\uff08\u5982 &lt;code&gt;2.0&lt;\/code&gt;\uff09\uff0c\u6807\u8bc6\u5305\u683c\u5f0f\u7248\u672c\u3002<\/li>\n<li><strong>&lt;code&gt;control.tar.gz&lt;\/code&gt;<\/strong><br \/>\n\u5305\u542b\u63a7\u5236\u4fe1\u606f\uff1a<\/p>\n<ul>\n<li>&lt;code&gt;control&lt;\/code&gt;\uff1a\u5305\u540d\u3001\u7248\u672c\u3001\u4f9d\u8d56\u7b49\u5143\u6570\u636e\uff1b<\/li>\n<li>&lt;code&gt;md5sums&lt;\/code&gt;\uff1a\u6587\u4ef6\u6821\u9a8c\u548c\uff1b<\/li>\n<li>\u811a\u672c\u6587\u4ef6\uff1a&lt;code&gt;preinst&lt;\/code&gt;\uff08\u5b89\u88c5\u524d\uff09\u3001&lt;code&gt;postinst&lt;\/code&gt;\uff08\u5b89\u88c5\u540e\uff09\u3001&lt;code&gt;prerm&lt;\/code&gt;\uff08\u5378\u8f7d\u524d\uff09\u3001&lt;code&gt;postrm&lt;\/code&gt;\uff08\u5378\u8f7d\u540e\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>&lt;code&gt;data.tar.xz&lt;\/code&gt;<\/strong><br \/>\n\u5b58\u653e\u5b9e\u9645\u8981\u5b89\u88c5\u7684\u6587\u4ef6\uff08\u5982\u4e8c\u8fdb\u5236\u3001\u914d\u7f6e\u6587\u4ef6\uff09\uff0c\u6309 Linux \u6587\u4ef6\u7cfb\u7edf\u5c42\u6b21\u6807\u51c6\uff08FHS\uff09\u7ec4\u7ec7\uff08\u5982 &lt;code&gt;\/usr\/bin&lt;\/code&gt;\u3001&lt;code&gt;\/etc&lt;\/code&gt;\uff09\u3002<\/li>\n<\/ol>\n<hr \/>\n<h3>\ud83d\udcc2 \u4e8c\u3001\u6e90\u4ee3\u7801\u76ee\u5f55\u7ec4\u7ec7\u683c\u5f0f<\/h3>\n<p>\u6784\u5efa Debian \u5305\u9700\u5728\u6e90\u4ee3\u7801\u6839\u76ee\u5f55\u521b\u5efa <strong>&lt;code&gt;debian\/&lt;\/code&gt; \u5b50\u76ee\u5f55<\/strong>\uff0c\u5b58\u653e\u6253\u5305\u63a7\u5236\u6587\u4ef6\u3002\u5178\u578b\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<pre><code>my-app\/\n\u251c\u2500\u2500 debian\/             # \u6253\u5305\u63a7\u5236\u76ee\u5f55\uff08\u5fc5\u9700\uff09\n\u2502   \u251c\u2500\u2500 control         # \u5305\u5143\u6570\u636e\uff08\u540d\u79f0\u3001\u4f9d\u8d56\u7b49\uff09\n\u2502   \u251c\u2500\u2500 copyright       # \u7248\u6743\u58f0\u660e\n\u2502   \u251c\u2500\u2500 changelog       # \u7248\u672c\u53d8\u66f4\u5386\u53f2\n\u2502   \u251c\u2500\u2500 rules           # \u6784\u5efa\u811a\u672c\uff08Makefile \u7c7b\uff09\n\u2502   \u251c\u2500\u2500 source\/         # \u6e90\u7801\u683c\u5f0f\u914d\u7f6e\uff08\u53ef\u9009\uff09\n\u2502   \u2514\u2500\u2500 ...             # \u5176\u4ed6\uff08\u5982\u670d\u52a1\u811a\u672c\u3001\u5b89\u88c5\u6a21\u677f\uff09\n\u251c\u2500\u2500 src\/                # \u9879\u76ee\u6e90\u4ee3\u7801\uff08\u4e0a\u6e38\u5185\u5bb9\uff09\n\u2502   \u251c\u2500\u2500 main.c\n\u2502   \u2514\u2500\u2500 ...\n\u251c\u2500\u2500 systemd\/            # \u670d\u52a1\u6587\u4ef6\uff08\u5982 .service\uff09\n\u251c\u2500\u2500 Makefile            # \u9879\u76ee\u6784\u5efa\u914d\u7f6e\n\u251c\u2500\u2500 README.md\n\u2514\u2500\u2500 LICENSE<\/code><\/pre>\n<h4><strong>&lt;code&gt;debian\/&lt;\/code&gt; \u76ee\u5f55\u5173\u952e\u6587\u4ef6\u8bf4\u660e<\/strong>\uff1a<\/h4>\n<table>\n<thead>\n<tr>\n<th><strong>\u6587\u4ef6<\/strong><\/th>\n<th><strong>\u4f5c\u7528<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>&lt;code&gt;control&lt;\/code&gt;<\/td>\n<td>\u5b9a\u4e49\u5305\u540d\u3001\u7248\u672c\u3001\u67b6\u6784\u3001\u4f9d\u8d56\u5173\u7cfb\uff08\u5982 &lt;code&gt;Depends: python3&lt;\/code&gt;\uff09\u3002<\/td>\n<\/tr>\n<tr>\n<td>&lt;code&gt;changelog&lt;\/code&gt;<\/td>\n<td>\u8bb0\u5f55\u7248\u672c\u53d8\u66f4\uff0c\u683c\u5f0f\u9700\u4e25\u683c\u9075\u5faa\uff08\u4f7f\u7528 &lt;code&gt;dch&lt;\/code&gt; \u5de5\u5177\u751f\u6210\uff09\u3002<\/td>\n<\/tr>\n<tr>\n<td>&lt;code&gt;rules&lt;\/code&gt;<\/td>\n<td>\u6784\u5efa\u811a\u672c\uff08\u5982\u8c03\u7528 &lt;code&gt;make&lt;\/code&gt;\uff09\uff0c\u9700\u53ef\u6267\u884c\u6743\u9650\u3002\u652f\u6301\u8986\u76d6\u6807\u51c6\u6b65\u9aa4\uff08&lt;code&gt;build&lt;\/code&gt;\u3001&lt;code&gt;install&lt;\/code&gt;\uff09\u3002<\/td>\n<\/tr>\n<tr>\n<td>&lt;code&gt;copyright&lt;\/code&gt;<\/td>\n<td>\u58f0\u660e\u8f6f\u4ef6\u8bb8\u53ef\u8bc1\u53ca\u7248\u6743\u5f52\u5c5e\u3002<\/td>\n<\/tr>\n<tr>\n<td>&lt;code&gt;install&lt;\/code&gt;<\/td>\n<td>\u6307\u5b9a\u9700\u5b89\u88c5\u7684\u6587\u4ef6\u53ca\u76ee\u6807\u8def\u5f84\uff08\u5982 &lt;code&gt;src\/myapp \/usr\/bin&lt;\/code&gt;\uff09\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>\ud83d\udca1 <strong>\u6ce8\u610f<\/strong>\uff1a  <\/p>\n<ul>\n<li>\u82e5\u9879\u76ee\u9700\u9002\u914d Debian \u5b98\u65b9\u6e90\uff0c\u5efa\u8bae\u901a\u8fc7 &lt;code&gt;.gitattributes&lt;\/code&gt; \u6392\u9664 &lt;code&gt;debian\/&lt;\/code&gt; \u76ee\u5f55\u5728\u6e90\u7801 tarball \u4e2d\u7684\u53d1\u5e03\u3002<\/li>\n<li>\u975e Debian \u539f\u751f\u5305\uff08\u5982\u4ece\u4e0a\u6e38\u6e90\u7801\u6784\u5efa\uff09\u9700\u5206\u79bb &lt;code&gt;debian\/&lt;\/code&gt; \u76ee\u5f55\uff1b\u82e5\u4e3a\u539f\u751f\u5305\uff08\u5982\u81ea\u7814\u8f6f\u4ef6\uff09\uff0c\u53ef\u76f4\u63a5\u5305\u542b\u5728\u6e90\u7801\u6811\u4e2d\u3002<\/li>\n<\/ul>\n<\/blockquote>\n<hr \/>\n<h3>\ud83d\udd27 \u4e09\u3001\u6784\u5efa Debian \u5305\u7684\u65b9\u6cd5<\/h3>\n<h4>\u73af\u5883\u51c6\u5907\uff08Debian\/Ubuntu\uff09\uff1a<\/h4>\n<pre><code class=\"language-bash\"># \u5b89\u88c5\u57fa\u7840\u7f16\u8bd1\u5de5\u5177\nsudo apt install build-essential devscripts dpkg-dev\n# \u5b89\u88c5\u4f9d\u8d56\u68c0\u67e5\u5de5\u5177\nsudo apt install fakeroot lintian<\/code><\/pre>\n<h4>\u6784\u5efa\u6b65\u9aa4\uff1a<\/h4>\n<ol>\n<li><strong>\u8fdb\u5165\u6e90\u7801\u76ee\u5f55<\/strong>\uff1a\n<pre><code class=\"language-bash\">cd my-app\/<\/code><\/pre>\n<\/li>\n<li><strong>\u5b89\u88c5\u6784\u5efa\u4f9d\u8d56<\/strong>\uff1a\n<pre><code class=\"language-bash\">sudo apt build-dep .   # \u81ea\u52a8\u89e3\u6790 control \u4e2d\u7684\u4f9d\u8d56<\/code><\/pre>\n<\/li>\n<li><strong>\u6267\u884c\u6784\u5efa<\/strong>\uff08\u4e8c\u9009\u4e00\uff09\uff1a\n<ul>\n<li><strong>&lt;code&gt;dpkg-buildpackage&lt;\/code&gt;<\/strong>\uff08\u57fa\u7840\u547d\u4ee4\uff09\uff1a\n<pre><code class=\"language-bash\">dpkg-buildpackage -rfakeroot -b -uc -us  # -b: \u4ec5\u6784\u5efa\u4e8c\u8fdb\u5236\u5305\uff1b-uc\/-us: \u4e0d\u7b7e\u540d<\/code><\/pre>\n<\/li>\n<li><strong>&lt;code&gt;debuild&lt;\/code&gt;<\/strong>\uff08\u63a8\u8350\uff0c\u81ea\u52a8\u68c0\u67e5\u89c4\u8303\uff09\uff1a\n<pre><code class=\"language-bash\">debuild -b -uc -us  # \u751f\u6210 .deb \u6587\u4ef6\u53ca\u65e5\u5fd7<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u8f93\u51fa\u6587\u4ef6<\/strong>\uff1a<br \/>\n\u751f\u6210\u7684 &lt;code&gt;.deb&lt;\/code&gt; \u4f4d\u4e8e\u4e0a\u7ea7\u76ee\u5f55\uff08\u5982 &lt;code&gt;..\/myapp_1.0-1_amd64.deb&lt;\/code&gt;\uff09\u3002<\/li>\n<\/ol>\n<blockquote>\n<p>\u26a0\ufe0f <strong>\u8de8\u5e73\u53f0\u6784\u5efa\u63d0\u793a<\/strong>\uff1a<br \/>\n\u5728\u975e Debian \u7cfb\u7edf\uff08\u5982 RHEL\uff09\u4e0a\u6784\u5efa\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528 Docker \u521b\u5efa\u7eaf\u51c0\u7684 Debian \u73af\u5883\uff1a<\/p>\n<pre><code class=\"language-bash\">docker run -v $(pwd):\/src -it debian:stable\napt update &amp;&amp; apt install build-essential\ncd \/src &amp;&amp; dpkg-buildpackage -b<\/code><\/pre>\n<\/blockquote>\n<hr \/>\n<h3>\ud83d\ude80 \u56db\u3001\u53d1\u5e03\u8f6f\u4ef6\u5305\u5230 PPA\uff08\u4e2a\u4eba\u8f6f\u4ef6\u4ed3\u5e93\uff09<\/h3>\n<p>\u901a\u8fc7 <a href=\"https:\/\/launchpad.net\">Launchpad<\/a> \u7684 PPA\uff08Personal Package Archive\uff09\u53d1\u5e03\uff0c\u5141\u8bb8\u7528\u6237\u901a\u8fc7 &lt;code&gt;apt&lt;\/code&gt; \u5b89\u88c5\uff1a<\/p>\n<h4><strong>\u6b65\u9aa4<\/strong>\uff1a<\/h4>\n<ol>\n<li><strong>\u6ce8\u518c\u4e0e\u914d\u7f6e<\/strong>\uff1a\n<ul>\n<li>\u521b\u5efa Launchpad \u8d26\u6237\uff08\u9700\u9a8c\u8bc1\u90ae\u7bb1\uff09\u3002<\/li>\n<li>\u751f\u6210 GPG \u5bc6\u94a5\uff084096 \u4f4d\uff09\u5e76\u4e0a\u4f20\u81f3 &lt;code&gt;keyserver.ubuntu.com&lt;\/code&gt;\uff1a\n<pre><code class=\"language-bash\">gpg --gen-key\ngpg --export --armor you@email.com | sudo apt-key add -<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u521b\u5efa PPA \u4ed3\u5e93<\/strong>\uff1a<br \/>\n\u5728 Launchpad \u63a7\u5236\u53f0\u65b0\u5efa PPA\uff08\u5982 &lt;code&gt;ppa:yourname\/yourrepo&lt;\/code&gt;\uff09\u3002<\/li>\n<li><strong>\u6784\u5efa\u6e90\u7801\u5305<\/strong>\uff08\u9700\u542b\u5b8c\u6574 &lt;code&gt;debian\/&lt;\/code&gt;\uff09\uff1a\n<pre><code class=\"language-bash\">debuild -S -sa  # -S: \u751f\u6210\u6e90\u7801\u5305\uff1b-sa: \u5305\u542b\u6e90\u7801<\/code><\/pre>\n<\/li>\n<li><strong>\u4e0a\u4f20\u5230 PPA<\/strong>\uff1a\n<pre><code class=\"language-bash\">dput ppa:yourname\/yourrepo ..\/myapp_1.0-1_source.changes<\/code><\/pre>\n<\/li>\n<\/ol>\n<h4><strong>\u7528\u6237\u5b89\u88c5\u65b9\u5f0f<\/strong>\uff1a<\/h4>\n<pre><code class=\"language-bash\">sudo add-apt-repository ppa:yourname\/yourrepo\nsudo apt update\nsudo apt install myapp<\/code><\/pre>\n<hr \/>\n<h3>\ud83d\udc8e \u4e94\u3001\u5173\u952e\u6ce8\u610f\u4e8b\u9879<\/h3>\n<ol>\n<li><strong>\u76ee\u5f55\u89c4\u8303<\/strong>\uff1a<br \/>\n\u5b89\u88c5\u6587\u4ef6\u9700\u6309 FHS \u90e8\u7f72\uff08\u5982\u4e8c\u8fdb\u5236\u81f3 &lt;code&gt;\/usr\/bin&lt;\/code&gt;\uff0c\u914d\u7f6e\u6587\u4ef6\u81f3 &lt;code&gt;\/etc&lt;\/code&gt;\uff09\u3002<\/li>\n<li><strong>\u4f9d\u8d56\u7ba1\u7406<\/strong>\uff1a<br \/>\n&lt;code&gt;control&lt;\/code&gt; \u6587\u4ef6\u9700\u660e\u786e\u5b9a\u4e49\u4f9d\u8d56\uff08\u5982 &lt;code&gt;Depends: libc6 (&gt;= 2.34)&lt;\/code&gt;\uff09\uff0c\u907f\u514d\u8fd0\u884c\u65f6\u7f3a\u5931\u3002<\/li>\n<li><strong>\u6d4b\u8bd5\u9a8c\u8bc1<\/strong>\uff1a\n<ul>\n<li>\u4f7f\u7528 &lt;code&gt;lintian&lt;\/code&gt; \u68c0\u67e5\u5305\u89c4\u8303\uff1a&lt;code&gt;lintian ..\/myapp.deb&lt;\/code&gt;\u3002<\/li>\n<li>\u5728\u7eaf\u51c0\u73af\u5883\u4e2d\u6d4b\u8bd5\u5b89\u88c5\/\u5378\u8f7d\u6d41\u7a0b\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<hr \/>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u53d1\u5e03 Debian \u8f6f\u4ef6\u5305\u7684\u6838\u5fc3\u5728\u4e8e\u89c4\u8303\u7ec4\u7ec7 &lt;code&gt;debian\/&lt;\/code&gt; \u63a7\u5236\u76ee\u5f55\uff0c\u5e76\u901a\u8fc7 &lt;code&gt;dpkg-buildpackage&lt;\/code&gt; \u6216 &lt;code&gt;debuild&lt;\/code&gt; \u6784\u5efa\u3002\u5bf9\u4e8e\u4e2a\u4eba\u5206\u53d1\uff0cPPA \u662f\u6700\u4fbf\u6377\u7684\u6258\u7ba1\u65b9\u6848\uff1b\u82e5\u9700\u8de8\u5e73\u53f0\u6784\u5efa\uff0c\u63a8\u8350\u4f7f\u7528 Docker \u5bb9\u5668\u9694\u79bb\u73af\u5883\u3002\u4e25\u683c\u9075\u5faa FHS \u548c Debian Policy \u53ef\u786e\u4fdd\u5305\u517c\u5bb9\u6027\u4e0e\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n<hr \/>\n<p>&lt;code&gt;apt-key&lt;\/code&gt; \u786e\u5b9e\u5df2\u5728\u6700\u65b0 Debian\/Ubuntu \u7248\u672c\u4e2d\u88ab\u5e9f\u5f03\u3002\u4ee5\u4e0b\u662f\u66f4\u65b0\u540e\u7684 GPG \u5bc6\u94a5\u7ba1\u7406\u65b9\u6cd5\uff1a<\/p>\n<h3>\ud83d\udd11 \u4fee\u6b63\u540e\u7684 GPG \u5bc6\u94a5\u7ba1\u7406\uff08\u66ff\u4ee3 &lt;code&gt;apt-key&lt;\/code&gt;\uff09<\/h3>\n<h4><strong>\u65b0\u65b9\u6cd5\u6b65\u9aa4<\/strong>\uff1a<\/h4>\n<ol>\n<li>\n<p><strong>\u751f\u6210 GPG \u5bc6\u94a5<\/strong>\uff1a<\/p>\n<pre><code class=\"language-bash\">gpg --full-generate-key<\/code><\/pre>\n<ul>\n<li>\u9009\u62e9\u5bc6\u94a5\u7c7b\u578b\uff1a&lt;code&gt;RSA (sign only)&lt;\/code&gt;<\/li>\n<li>\u5bc6\u94a5\u957f\u5ea6\uff1a&lt;code&gt;4096&lt;\/code&gt;<\/li>\n<li>\u8bbe\u7f6e\u59d3\u540d\u548c\u90ae\u7bb1\uff08\u9700\u4e0e Launchpad \u6ce8\u518c\u90ae\u7bb1\u4e00\u81f4\uff09<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5bfc\u51fa\u516c\u94a5\u5230\u6587\u4ef6<\/strong>\uff1a<\/p>\n<pre><code class=\"language-bash\">gpg --export --armor you@email.com &gt; my-public-key.asc<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u5c06\u516c\u94a5\u6dfb\u52a0\u5230 APT \u4fe1\u4efb\u94fe\uff08\u65b0\u6807\u51c6\u65b9\u6cd5\uff09<\/strong>\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo mkdir -p \/etc\/apt\/keyrings\nsudo gpg --dearmor -o \/etc\/apt\/keyrings\/my-key.gpg my-public-key.asc<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u4e0a\u4f20\u516c\u94a5\u5230 Ubuntu \u5bc6\u94a5\u670d\u52a1\u5668<\/strong>\uff1a<\/p>\n<pre><code class=\"language-bash\">gpg --keyserver keyserver.ubuntu.com --send-keys &lt;KEY-ID&gt;<\/code><\/pre>\n<p>\u901a\u8fc7 &lt;code&gt;gpg --list-secret-keys&lt;\/code&gt; \u67e5\u770b &lt;code&gt;&lt;KEY-ID&gt;&lt;\/code&gt;\uff08\u7c7b\u4f3c &lt;code&gt;3B4FE6ACC0B21F32&lt;\/code&gt;\uff09<\/p>\n<\/li>\n<li>\n<p><strong>\u5728 Launchpad \u8d26\u6237\u4e2d\u6dfb\u52a0\u6b64\u5bc6\u94a5<\/strong>\uff1a<\/p>\n<ul>\n<li>\u767b\u5f55 <a href=\"https:\/\/launchpad.net\">Launchpad<\/a><\/li>\n<li>\u8fdb\u5165 &lt;code&gt;~\/.gnupg\/openpgp-revocs.d&lt;\/code&gt; \u627e\u5230 &lt;code&gt;.rev&lt;\/code&gt; \u540a\u9500\u8bc1\u4e66\uff08\u53ef\u9009\uff09<\/li>\n<li>\u5728\u8d26\u6237\u8bbe\u7f6e\u4e2d\u5bfc\u5165\u5bc6\u94a5<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<hr \/>\n<h3>\ud83d\udce4 \u66f4\u65b0\u540e\u7684 PPA \u4e0a\u4f20\u6d41\u7a0b<\/h3>\n<h4><strong>\u6784\u5efa\u7b7e\u540d\u6e90\u7801\u5305<\/strong>\uff1a<\/h4>\n<pre><code class=\"language-bash\">debuild -S -sa  # -sa \u786e\u4fdd\u5305\u542b\u5b8c\u6574\u6e90\u7801<\/code><\/pre>\n<h4><strong>\u4e0a\u4f20\u5230 PPA<\/strong>\uff1a<\/h4>\n<pre><code class=\"language-bash\">dput ppa:yourname\/yourrepo ..\/myapp_1.0-1_source.changes<\/code><\/pre>\n<hr \/>\n<h3>\ud83d\udc65 \u7528\u6237\u7aef\u5b89\u88c5\u66f4\u65b0\uff08\u65b0\u5bc6\u94a5\u7cfb\u7edf\uff09<\/h3>\n<p>\u7528\u6237\u6dfb\u52a0 PPA \u65f6\u4ecd\u4f7f\u7528\u6807\u51c6\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo add-apt-repository ppa:yourname\/yourrepo\nsudo apt update<\/code><\/pre>\n<h4>\u5e95\u5c42\u53d8\u5316\uff1a<\/h4>\n<p>&lt;code&gt;add-apt-repository&lt;\/code&gt; \u73b0\u5728\u4f1a\u81ea\u52a8\uff1a<\/p>\n<ol>\n<li>\u5728 &lt;code&gt;\/etc\/apt\/sources.list.d\/&lt;\/code&gt; \u521b\u5efa &lt;code&gt;.list&lt;\/code&gt; \u6587\u4ef6<\/li>\n<li>\u5728 &lt;code&gt;\/etc\/apt\/keyrings\/&lt;\/code&gt; \u6dfb\u52a0\u5bf9\u5e94\u7684 &lt;code&gt;.gpg&lt;\/code&gt; \u5bc6\u94a5\u73af<\/li>\n<li>\u5728 &lt;code&gt;.list&lt;\/code&gt; \u6587\u4ef6\u4e2d\u663e\u5f0f\u6307\u5b9a\u5bc6\u94a5\u8def\u5f84\uff1a\n<pre><code class=\"language-plaintext\">deb [signed-by=\/etc\/apt\/keyrings\/my-key.gpg] https:\/\/ppa.launchpadcontent.net\/yourname\/yourrepo\/ubuntu jammy main<\/code><\/pre>\n<\/li>\n<\/ol>\n<hr \/>\n<h3>\u26a0\ufe0f \u5173\u952e\u6ce8\u610f\u4e8b\u9879<\/h3>\n<ol>\n<li>\n<p><strong>\u5bc6\u94a5\u76ee\u5f55\u6743\u9650<\/strong>\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo chmod 644 \/etc\/apt\/keyrings\/*.gpg  # \u786e\u4fdd\u5168\u5c40\u53ef\u8bfb<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u65e7\u7cfb\u7edf\u517c\u5bb9<\/strong>\uff1a<br \/>\n\u5982\u9700\u652f\u6301 Ubuntu 20.04 \u7b49\u65e7\u7cfb\u7edf\uff1a<\/p>\n<pre><code class=\"language-bash\">sudo cp my-public-key.asc \/usr\/share\/keyrings\/\nsudo ln -s \/usr\/share\/keyrings\/my-public-key.asc \/etc\/apt\/trusted.gpg.d\/<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5bc6\u94a5<\/strong>\uff1a<\/p>\n<pre><code class=\"language-bash\">apt-key list  # \u5df2\u5e9f\u5f03\uff0c\u6539\u7528\uff1a\ngpg --list-keys --keyring \/etc\/apt\/keyrings\/my-key.gpg<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>\u8fd9\u4e9b\u66f4\u6539\u9075\u5faa Debian <a href=\"https:\/\/salsa.debian.org\/apt-team\/apt\/-\/blob\/main\/doc\/rfc8220.txt\">RFC 8220<\/a> \u89c4\u8303\uff0c\u63d0\u4f9b\u66f4\u5b89\u5168\u7684\u5bc6\u94a5\u7ba1\u7406\u673a\u5236\uff0c\u907f\u514d\u4e86\u5168\u5c40\u5bc6\u94a5\u73af\u7684\u5b89\u5168\u98ce\u9669\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Debian \u7cfb\u7edf\u4e2d\u53d1\u5e03\u81ea\u884c\u7f16\u8bd1\u7684\u8f6f\u4ef6\u5305\u9700\u9075\u5faa\u5176\u6253\u5305\u89c4\u8303\uff0c\u6d89\u53ca\u76ee\u5f55\u7ed3\u6784\u3001\u6784\u5efa\u5de5\u5177\u548c\u53d1\u5e03\u6d41\u7a0b\u3002\u4ee5\u4e0b\u662f\u5173\u952e\u6b65\u9aa4 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":"","footnotes":""},"categories":[26],"tags":[],"class_list":["post-307","post","type-post","status-publish","format-standard","hentry","category-foss","pmpro-has-access"],"_links":{"self":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/comments?post=307"}],"version-history":[{"count":2,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/307\/revisions"}],"predecessor-version":[{"id":413,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/posts\/307\/revisions\/413"}],"wp:attachment":[{"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/media?parent=307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/categories?post=307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qkd.koudaipc.com\/en\/wp-json\/wp\/v2\/tags?post=307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}