Introduction
On "Enterprise Linux" variants--CentOS, CloudLinux, AlmaLinux, and RockyLinux--you can utilize the 'yum' utility to manage RPM packages installed on the system. On EL8 and above, it is recommended to use 'dnf' rather than 'yum,' however, both will work.
Yum can replace packages with different variants of the same package, either from different repositories, or different versions from the same repository. You may need to swap packages after removing CloudLinux or trying a "testing" package for a bugfix before a package has reached stable.
Procedure
If you're trying to replace a package with a different version, rather than remove and reinstall all of the packages that depend on it, you can swap the package:
yum swap -- remove $OLD -- install $NEW
You can replace all packages from a repository using the following command where $REPO is replaced with the repository name.
packages=$(yum list installed | grep $REPO | grep -v "^\s" | cut -d. -f1)
yum swap -- remove $packages -- install $packages
You can find out what repository a package is from by running the following command, where $PACKAGE is replaced with the actual package name.
yum list installed | grep $PACKAGE | awk '{print $NF}'
Comments
0 comments
Article is closed for comments.