averainy's Blog

averainy

12 May 2024

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:

  1. using the command line
sudo dnf upgrade --exclude=packagename
  1. using its configuration files You can add a line to /etc/dnf/dnf.conf to exclude packages:
excludepkgs=packagename
  1. 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

Categories