How to lock a package to not be updated or reinstalled in CentOS

161 Views Asked by At

I've already installed a patched version of a package, and I don't want it be updated or reinstalled in any case.

What I have tried but not success:

  • using exclude=package-name* in /etc/yum.conf: I can still yum reinstall package-name.rpm
  • using yum versionlock package-name: same as above, I can still yum reinstall package-name.rpm

Anyone have any ideas?

Thanks

1

There are 1 best solutions below

2
Chukwujiobi Canon On

using yum versionlock package-name: same as above, I can still yum reinstall package-name.rpm

You should use yum-versionlock instead because that is the yum plug-in that does the job.

SYNOPSIS
yum-versionlock [ package-name [ package-name]] ...

DESCRIPTION
yum-versionlock is a Yum plugin that takes a set of name/versions for packages and excludes all other versions of those packages (including optionally following obsoletes). This allows you to protect packages from being updated by newer versions.

The Man pages