yum 更新软件包
We may not want to update some packages such the kernel on a stable server while updating the system. If we run “dnf update” or “yum update”, we may get suggested by dnf/yum to install all the packages with updates.
在更新系统时,我们可能不希望在稳定的服务器上更新某些软件包,例如内核。 如果运行“ dnf更新”或“ yum更新”,则dnf / yum可能会建议您安装所有带有更新的软件包。
In this post, how to make dnf/yum
not update certain packages such the kernel when updating system will be introduced.
在这篇文章中,将介绍如何在更新系统时使dnf/yum
不更新某些软件包,例如内核。
方法使得DNF /百胜不更新某些包∞ (Method making dnf/yum not update certain packages ∞)
The method is simple. Add this line to dnf or yum’s configuration file:
该方法很简单。 将此行添加到dnf或yum的配置文件中:
exclude=package_names package_name_pattern
For example, to exclude package kernel*, nss and nss-* from being updated, the line will be:
例如,要从更新中删除软件包kernel *,nss和nss- *,该行将为:
exclude=kernel* nss nss-*
Package names are separated by a space. Shell globs using wildcards (eg. * and ?) are allowed.
程序包名称之间用空格分隔。 允许使用通配符(例如*和?)的Shell glob。
对于DNF / yum的配置文件∞ (The configuration file for dnf/yum ∞)
The configuration file for dnf and yum are different. For newer systems like Fedora 22+, the dnf one will be used unless you install the yum-obsoleted package.
dnf和yum的配置文件不同。 对于Fedora 22+等较新的系统 ,除非安装了yum已过时的软件包,否则将使用dnf。
For dnf, the configuration file is located under:
对于dnf,配置文件位于以下位置:
/etc/dnf/dnf.conf
For yum, the configuration file is located under:
对于yum,配置文件位于以下位置:
/etc/yum.conf
翻译自: https://www.systutorials.com/making-dnf-yum-not-update-certain-packages/
yum 更新软件包