User Tools

Site Tools


redhat_-_packages:exclude_certain_packages_from_yum-cron_but_not_from_yum

Redhat - Packages - Exclude certain packages from yum-cron (but not from yum)

How to exclude certain packages being updated when using yum-cron.


Exclude certain packages from yum-cron

Docker and kernel are packages I would like to exclude from yum-cron.

Modify the /etc/yum/yum-cron.conf file adding this to the [base] section:

RHEL7/Centos7

/etc/yum/yum-cron.conf
[base]
...
exclude = kernel* docker*

RHEL6/Centos6

Use the YUM_PARAMETER to do the same thing:

/etc/yum/yum-cron.conf
YUM_PARAMETER=kernel* docker*

Exclude certain packages from yum altogether

This required the affected yum repository to be modified.

For example, to permanently exclude certain packages like Docker from being updated using the yum command/CLI.

RHEL7

Modify /etc/yum.repos.d/redhat.repo:

  • Add the following line under [rhel-7-server-extras-rpms]:
/etc/yum.repos.d/redhat.repo
[rhel-7-server-extras-rpms]
exclude = docker*

NOTE: Before adding an exclude command, verify that the exclude line is added under the right repository.

  • For example:
    sudo yum info docker
    • returns:
  • From repo : rhel-7-server-extras-rpms
redhat_-_packages/exclude_certain_packages_from_yum-cron_but_not_from_yum.txt · Last modified: 2023/07/17 15:04 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki