{"id":330,"date":"2018-03-14T00:00:25","date_gmt":"2018-03-13T16:00:25","guid":{"rendered":"https:\/\/cloudbool.com\/archive\/?p=330"},"modified":"2018-03-14T00:00:25","modified_gmt":"2018-03-13T16:00:25","slug":"debian-ubuntu-hold-package-do-not-allow-upgrade","status":"publish","type":"post","link":"https:\/\/cloudbool.com\/archive\/debian-ubuntu-hold-package-do-not-allow-upgrade.html","title":{"rendered":"Debian\/Ubuntu\u56fa\u5b9a\u8f6f\u4ef6\u5305\u4e0d\u5141\u8bb8\u5347\u7ea7"},"content":{"rendered":"<p>\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6bd4\u5982\u8bf4\u6211\u4eec<a href=\"Debian\u7cfb\u7edf\u91cd\u65b0\u6253\u5305nginx\u683c\u5f0fdeb\u8f6f\u4ef6\u5305\">\u81ea\u884c\u7f16\u8bd1\u7684\u8f6f\u4ef6\u5305<\/a>\u5b89\u88c5\u4e4b\u540e\uff0c\u9700\u8981\u56fa\u5b9a\u5728\u67d0\u4e2a\u7248\u672c\uff0c\u9632\u6b62\u66f4\u65b0\u7cfb\u7edf\u7684\u65f6\u5019\u7279\u5b9a\u7684\u8f6f\u4ef6\u5305\u4e5f\u8ddf\u7740\u5347\u7ea7\u800c\u51fa\u9519\uff0c\u8981\u5347\u7ea7\u7684\u65f6\u5019\u518d\u624b\u52a8\u5347\u7ea7\uff0c\u6298\u817e\u4e86\u4e00\u4e0b\uff0c\u987a\u624b\u8bb0\u5f55\u4e00\u4e0b\u6298\u817e\u8fc7\u7a0b\u3002<br \/>\n<!--more--><br \/>\n\u5b89\u88c5\u8f6f\u4ef6\u5305\uff0c\u6211\u4eec\u5e38\u7528\u7684\u6709\u4e24\u79cd\u65b9\u5f0f\uff0c\u4e00\u79cd\u662f\u5305\u7ba1\u7406\uff08apt\uff09\uff0c\u4e00\u79cd\u662f\u76f4\u63a5\u5b89\u88c5\u8f6f\u4ef6\u5305\uff08dpkg\uff09\uff0c\u6211\u8fd9\u4e5f\u8bb0\u5f55\u4e00\u4e0b\u8fd9\u4e24\u79cd\u65b9\u5f0f\u7684\u56fa\u5b9a\u65b9\u6cd5\u3002<\/p>\n<h2>apt\u547d\u4ee4\u56fa\u5b9a\u8f6f\u4ef6\u5305<\/h2>\n<p>\u56fa\u5b9a\u8f6f\u4ef6\u5305\uff1a<\/p>\n<pre><code>apt-mark hold &lt;package-name&gt;\n<\/code><\/pre>\n<p>\u53d6\u6d88\u56fa\u5b9a\uff1a<\/p>\n<pre><code>apt-mark unhold &lt;package-name&gt;\n<\/code><\/pre>\n<p>\u67e5\u770b\u56fa\u5b9a\u5217\u8868\uff1a<\/p>\n<pre><code>apt-mark hold showhold\n<\/code><\/pre>\n<h2>dkpg\u5b89\u88c5\u7684\u5305\u56fa\u5b9a<\/h2>\n<p>\u56fa\u5b9a\u8f6f\u4ef6\u5305\uff1a<\/p>\n<pre><code>echo \"&lt;package-name&gt; hold\" | dpkg --set-selections\n<\/code><\/pre>\n<p>\u53d6\u6d88\u56fa\u5b9a\uff1a<\/p>\n<pre><code>echo \"&lt;package-name&gt; install\" | dpkg --set-selections\n<\/code><\/pre>\n<p>\u67e5\u770b\u56fa\u5b9a\u5217\u8868\uff1a<\/p>\n<pre><code>dpkg --get-selections | grep \"&lt;package-name&gt;\"\n<\/code><\/pre>\n<p>CentOS7\u7cfb\u7edf\u67e5\u770b\u8fd9\u91cc\uff1a<a href=\"https:\/\/cloudbool.com\/archive\/post\/centos-7-hold-package.html\">CentOS 7\u7cfb\u7edfhold\u5305\u4e0d\u5141\u8bb8\u5347\u7ea7<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6bd4\u5982\u8bf4\u6211\u4eec\u81ea\u884c\u7f16\u8bd1\u7684\u8f6f\u4ef6\u5305\u5b89\u88c5\u4e4b\u540e\uff0c\u9700\u8981\u56fa\u5b9a\u5728\u67d0\u4e2a\u7248\u672c\uff0c\u9632\u6b62\u66f4\u65b0\u7cfb\u7edf\u7684\u65f6\u5019\u7279\u5b9a\u7684\u8f6f\u4ef6\u5305\u4e5f\u8ddf\u7740\u5347\u7ea7\u800c &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/cloudbool.com\/archive\/debian-ubuntu-hold-package-do-not-allow-upgrade.html\"> <span class=\"screen-reader-text\">Debian\/Ubuntu\u56fa\u5b9a\u8f6f\u4ef6\u5305\u4e0d\u5141\u8bb8\u5347\u7ea7<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[182],"tags":[27,103],"class_list":["post-330","post","type-post","status-publish","format-standard","hentry","category-linux","tag-debian","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/comments?post=330"}],"version-history":[{"count":0,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/330\/revisions"}],"wp:attachment":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/media?parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/categories?post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/tags?post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}