Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to lock software version in CentOS system to prevent upgrade

Shulou Source: shulou.com Published: 2022-06-01 08:20:33 09月17日 Update

This article mainly explains "how to lock the software version in the CentOS system to prevent the upgrade". The explanation in the article is simple and clear and easy to learn and understand. please follow the editor's train of thought to study and learn "how to lock the software version in the CentOS system to prevent the upgrade"!

.

Locking the specified software version in a Yum upgrade prevents it from upgrading as follows:

1. To install versionlock first, type:

The code is as follows:

# yum install yum-versionlock

two。 View / etc/yum/pluginconf.d/versionlock.conf file

The code is as follows:

# vi / etc/yum/pluginconf.d/versionlock.conf

It is displayed as:

The code is as follows:

[main]

Enabled = 1

Locklist = / etc/yum/pluginconf.d/versionlock.list

# Uncomment this to lock out "upgrade via. Obsoletes" etc. (slower)

# follow_obsoletes = 1

Enabled = 0 | 1

Turn versionlock on or off

The code is as follows:

Locklist = / path/to/file

Define the absolute path to the versionlock lock software list file versionlock.list, here / etc/yum/pluginconf.d/versionlock.list

/ etc/yum/pluginconf.d/versionlock.list, the format of the locked file is one package name per line

Make sure you have enabled = 1 in the file, and add it if you don't. After installation, the default enabled is 1, that is, the versionlock plug-in is enabled.

3. Add the name and version of the package that needs to be locked to / etc/yum/pluginconf.d/versionlock.list, one line per line

Suppose we want to lock the version of nagios-plugins and not let yum upgrade it, then copy the following line into versionlock.list

The code is as follows:

Nagios-plugins-1.4.11-1.el5.rf.x86_64

Save versionlock.list after you add it, and try the following command to try to upgrade nagios. Input

The code is as follows:

# yum update nagios-plugins

It will prompt:

The code is as follows:

...

Setting up Update Process

No Packages marked for Update

Skills (tip)

In fact, a better way is to use the pipe command to directly add the name of the package to be locked to versionlock.list. If you lock the ppp upgrade here, type:

The code is as follows:

# rpm-qa | grep ppp > > / etc/yum/pluginconf.d/versionlock.list

Then, check whether the addition is successful or not, and enter:

The code is as follows:

# cat / etc/yum/pluginconf.d/versionlock.list

If the display:

The code is as follows:

Ppp-2.4.4-2.el5

It means that the addition is successful!

Thank you for your reading, the above is the content of "how to lock the software version in the CentOS system to prevent the upgrade". After the study of this article, I believe you have a deeper understanding of how to lock the software version in the CentOS system to prevent the upgrade, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Software upgrades code versions systems files software packages inputs that is learning success one line content names commands methods ideas situations techniques plug-ins Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MySQL Shulou Technology Linux NVidia