[LINUX] How to prevent package updates with apt

I used to put a custom build nginx as a deb package, but it was updated by apt and nginx could not be started, so I will write it as a memorandum.

Suppress updates

Do it as root or run it with sudo.

apt-mark hold <package name>

** Example: **

apt-mark hold nginx

That way, running ```apt upgrade `` `will be ignored.

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.

Release suppression of updates

With the same privileges as above.

apt-mark unhold <package name>

** Example: **

apt-mark unhold nginx

This will remove the deterrence.

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] 

How to check which packages are being suppressed

apt-mark showhold

Type this command to see the packages that are being suppressed.

If nothing is returned, there are no packages being suppressed.

References

Recommended Posts

How to prevent package updates with apt
How to add a package with PyCharm
How to update with SQLAlchemy?
How to cast with Theano
How to Alter with SQLAlchemy?
How to separate strings with','
How to RDP with Fedora31
How to Delete with SQLAlchemy?
How to cancel RT with tweepy
Detects Linux (yum / apt) package updates
Python: How to use async with
How to deal with imbalanced data
How to install python-pip with ubuntu20.04LTS
How to create a Conda package
How to deal with imbalanced data
[Ansible] How to prevent forced change
How to get started with Scrapy
How to get started with Python
How to use Nix package manager
How to deal with DistributionNotFound errors
How to get started with Django
How to Data Augmentation with PyTorch
How to use FTP with Python
How to calculate date with python
How to install mysql-connector with pip3
How to INNER JOIN with SQLAlchemy
How to install Anaconda with pyenv
How to authenticate with Django Part 2
How to authenticate with Django Part 3
How to do arithmetic with Django template
[Blender] How to set shape_key with script
How to package and distribute Python scripts
How to get parent id with sqlalchemy
How to install DLIB with 2020 / CUDA enabled
How to use ManyToManyField with Django's Admin
How to use OpenVPN with Ubuntu 18.04.3 LTS
How to use Cmder with PyCharm (Windows)
How to work with BigQuery in Python
How to install a package using a repository
How to use Ass / Alembic with HtoA
How to deal with enum compatibility errors
How to use Japanese with NLTK plot
How to do portmanteau test with python
How to search Google Drive with Google Colaboratory
How to display python Japanese with lolipop
How to download youtube videos with youtube-dl
How to use jupyter notebook with ABCI
How to power off Linux with Ultra96-V2
"How to pass PATH" to learn with homebrew
How to scrape websites created with SPA
How to use CUT command (with sample)
How to enter Japanese with Python curses
[Python] How to deal with module errors
Stream redmine updates to hipchat with python
How to install zsh (with .zshrc customization)
How to read problem data with paiza
How to use SQLAlchemy / Connect with aiomysql
How to get started with laravel (Linux)
How to group volumes together with LVM
How to install python3 with docker centos
How to use JDBC driver with Redash