如何限制deb包被自动升级(想保留老版本)

转载自:https://askubuntu.com/questions/18654/how-to-prevent-updating-of-a-specific-package

dpkg或者apt二选一即可

dpkg层面

# Put a package on hold:
echo "<package-name> hold" | sudo dpkg --set-selections

# Remove the hold:
echo "<package-name> install" | sudo dpkg --set-selections

# Display the status of your packages:
dpkg --get-selections

# Display the status of a single package:
dpkg --get-selections | grep "<package-name>"

apt层面

# Hold a package:
sudo apt-mark hold <package-name>

# Remove the hold:
sudo apt-mark unhold <package-name>

# Show all packages on hold:
sudo apt-mark showhold

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *