Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Exclude specific packages from Yum

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

As part of the system update, you may need to exclude some software packages due to application dependencies in Red Hat-based systems. If so, how can it be excluded? How many ways can be taken? There are three ways to do this, and we will teach you these three methods in this article.

The package manager is a set of tools that allow users to easily manage packages in the Linux system. It allows users to install, update / upgrade, delete, query, reinstall and search software packages on Linux systems.

For Red Hat-based systems, we use yum package manager and rpm package manager for package management.

What is yum?

Yum stands for "Yellowdog Updater, Modified". Yum is an automatic update and package installer / unloader for rpm systems.

It automatically resolves dependencies when you install the package.

What is rpm?

Rpm stands for "Red Hat Package Manager" and is a powerful package management tool for Red Hat systems.

RPM refers to the .rpm file format, which contains compiled software and necessary libraries.

Method 1: manually or temporarily exclude packages with the yum command

We can use the-- exclude or-x switch in yum to prevent the yum command from getting updates for a specific package.

I can say that this is a temporary method or an on-demand approach. If you only want to exclude a specific package once, then we can use this method.

The following command updates all packages except kernel.

To exclude a single package:

# yum update-exclude=kernel or # yum update-x 'kernel'

Multiple packages should be excluded. The following command updates all packages except kernel and php.

# yum update-- exclude=kernel*-- exclude=php* or # yum update-- exclude httpd,php method 2: permanently exclude software packages in the yum command

This is a permanent method, and you can use it if you perform patch updates frequently.

To do this, add the appropriate package to / etc/yum.conf to permanently disable package updates.

Once added, you do not need to specify these packages each time you run the yum update command. In addition, this prevents any accidental updates to these packages.

# vi / etc/yum.conf [main] cachedir=/var/cache/yum/$basearch/$releaseverkeepcache=0debuglevel=2logfile=/var/log/yum.logexactarch=1obsoletes=1gpgcheck=1plugins=1installonly_limit=3exclude=kernel* php* method 3: use Yum versionlock plug-ins to exclude packages

This is also a permanent method similar to the above. The Yum versionlock plug-in allows users to lock updates to a specified package through the yum command.

To do this, run the following command. The following command excludes the freetype package from yum update.

Alternatively, you can add entries directly to / etc/yum/pluginconf.d/versionlock.list.

# yum versionlock add freetype Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlockAdding versionlock on: 0:freetype-2.8-12.el7versionlock added: 1

Run the following command to check the list of packages that are locked by the versionlock plug-in.

# yum versionlock list Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock0:freetype-2.8-12.el7.*versionlock list done

Run the following command to clear the list.

# yum versionlock clear

Original address: https://www.linuxprobe.com/yum-excludes-specific-packages.html

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report