Exclude Package When Use Dnf Update or Upgrade Command
Sometimes it is useful to ignore specific packages from transactions, such as updates,upgrade. One such case, for example, could be when an update includes a regression or a bug. DNF allows you to exclude a package from the transaction:
- using the command line
sudo dnf upgrade --exclude=packagename
- using its configuration files You can add a line to /etc/dnf/dnf.conf to exclude packages:
excludepkgs=packagename
- Using the DNF Versionlock plugin
# install versionlock
sudo dnf install 'dnf-command(versionlock)'
# lock the currently installed version of a package
sudo dnf versionlock add package
# remove the version lock
sudo dnf versionlock delete package
# list all locked packages
sudo dnf versionlock list