In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how linux excludes / retains / blocks specific software packages from apt upgrades, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.
Method 1: how to use the apt-mark command to exclude software package updates on Debian/Ubuntu systems
Apt-mark is used to mark / unmark packages as automatic installation.
The hold option is used to mark packages as reserved to prevent them from being automatically installed, upgraded, or deleted.
The unhold option is used to cancel the previous setting to allow all operations to be repeated.
Run the following command to retain the specified package using the apt-mark command.
$sudo apt-mark hold nanonano set on hold.
After you keep the packages, run the following apt-mark command to view them.
$sudo apt-mark showholdnano
This indicates that the nano package will not be upgraded when a full system update is performed.
$sudo apt update Reading package lists... DoneBuilding dependency treeReading state information... DoneCalculating upgrade... DoneThe following packages have been kept back: nano0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Use the apt-mark command to unreserve the nano package by running the following command.
$sudo apt-mark unhold nanoCanceled hold on nano. Method 2: how to use the dpkg command to exclude package updates on a Debian/Ubuntu system
The dpkg command is a CLI tool for installing, building, removing, and managing Debian packages. The main and more user-friendly front end of dpkg is aptitude.
Run the following command to block the given package using the dpkg command.
Syntax:
$echo "package_name hold" | sudo dpkg-- set-selections
Run the following dpkg command to keep the apache2 package.
$echo "apache2 hold" | sudo dpkg-- set-selections
After you keep the packages, run the following command to view them.
$sudo dpkg-- get-selections | grep "hold" apache2 hold
It shows that the apache2 package will not be upgraded when a full system update is performed.
$sudo apt update Reading package lists... DoneBuilding dependency treeReading state information... DoneCalculating upgrade... DoneThe following packages have been kept back: apache20 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Use the dpkg command to unreserve the specified package by running the following command.
Syntax:
$echo "package_name install" | sudo dpkg-- set-selections
Use the dpkg command to unreserve the apache2 package by running the following command.
$echo "apache2 install" | sudo dpkg-- set-selections method 3: how to use the aptitude command to exclude software package updates on Debian/Ubuntu systems
The aptitude command is a text-based package management interface for Debian and its derivative versions.
It allows users to view a list of packages and perform package management tasks, such as installing, upgrading, and removing packages. It can perform operations from the visual interface or from the command line.
Use the aptitude command to keep the specified package by running the following command.
$sudo aptitude hold python3
After you keep some packages, run the following command to view them.
$sudo dpkg-- get-selections | grep "hold" or $sudo apt-mark showhold python3
This indicates that the python3 package will not be upgraded when a complete system update is performed.
$sudo apt update Reading package lists... DoneBuilding dependency treeReading state information... DoneCalculating upgrade... DoneThe following packages have been kept back: python30 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Use the aptitude command to run the following command to unreserve the python3 package.
Sudo aptitude unhold python3 thank you for reading this article carefully. I hope the article "how to exclude / retain / block specific software packages from apt upgrades" shared by the editor will be helpful to you. At the same time, I hope you will support us and follow the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.