How to prevent software package upgrades in Ubuntu

Source: Internet
Author: User
If you want to upgrade the software in Ubuntu but want to keep one of them in the current state, that is, it will not be upgraded, you can use the command dpkg, aptitude or dselect for delayed upgrade/via1. use dpkg to select the software package for delayed upgrade: sudoecho "packagehold" | dpkg -- set-selections for example, to delay the upgrade of apache2 software package: sudoecho "apache2

If you want to upgrade the software in Ubuntu but want to keep one of them in the current state, that is, it will not be upgraded, you can use the command dpkg, aptitude or dselect to delay the upgrade/

1. Use dpkg

To select the software package for delayed upgrade:

Sudo echo "package hold" | dpkg -- set-selections

For example, to upgrade the apache2 package by delay:

Sudo echo "apache2 hold" | dpkg -- set-selections

Unselect:

Sudo echo "package hold" | dpkg -- set-selections

For example:

Sudo echo "apache2 hold" | dpkg -- set-selections

To use this command, you must understand the status of the selected software package.

2. Use aptitude

To select the software package for delayed upgrade:

Sudo aptitude hold package_name

Example:

Sudo aptitude hold apache2

Unselect:

Sudo aptitude unhold package_name

Example:

Sudo aptitude unhold apache2

3. Use dselect

If you have installed the dselect software package, you can first go to [S] elect screen, find the software package you want to delay the upgrade, and then press the "=" key or "H" key, then exit to take effect immediately. If you do not understand dselect usage, click link

In fact, apt-get and dselect use different files to store package information.
Apt:/var/lib/apt/lists/

Dselect/dpkg/tasksel:/var/lib/dpkg/

Difference between apt-get and dselect: link

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.