Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@YuzuRyo61

aptでパッケージの更新を抑止する方法

More than 1 year has passed since last update.

カスタムビルドのnginxをdebパッケージとしていれていたのですが、aptにより更新されてしまい、nginxが起動できなくなったことがあったので備忘録を兼ねて書いておきます。

更新を抑止

rootでやるか、sudoで実行します。

apt-mark hold <パッケージ名>

例:

apt-mark hold nginx

こうすることで、apt upgradeを実行しても無視されるようになります。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  nginx
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

更新の抑止を解除

上と同様の権限で。

apt-mark unhold <パッケージ名>

例:

apt-mark unhold nginx

こうすれば抑止を解除できます。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  nginx
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 851 kB of archives.
After this operation, 30.7 kB disk space will be freed.
Do you want to continue? [Y/n] 

抑止中のパッケージを確認する方法

apt-mark showhold

このコマンドを打つと抑止中のパッケージが表示されます。

もし何も返ってこない場合は抑止中のパッケージがないことになります。

参考文献

0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
YuzuRyo61
"Hello World!"と書き続けているだけ。ウェブアプリ好き。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?