Reputation: 33
Does anybody know what would happen if a package gets installed, while the old package remains installed? The thing is that the command rpm -e <rpm_package>
will uninstall and delete the old package. In my case, I want to keep the old package as a backup and I don't want it to get erased.
Is it possible to keep the old package available in the file system(without deleting it) while having installed the new one? Thanks in advance!
Upvotes: 1
Views: 2093
Reputation: 11
You can have two packages with the same name, with different version numbers, but the actual content from the newer RPM is going to overwrite the files from the older RPM. Each RPM contains a checksum for every file it installs, so when the older RPM is removed, it only deletes files where the checksum still matches. The newer version will be left intact.
Upvotes: 1
Reputation: 270
Yes, this is possible. It is not documented, but when you install an RPM with both the
--nodeps
and --force
options
It turns out yum really does disable ALL dependency logic
This is the other way to get into the state of having duplicates besides:
you terminate rpm during the transaction.
If you don't believe me give it a try on a CentOS 7 server. It's possible this behavior has changed in dnf - after all it was meant to be an upgrade to yum. That would not shock me.
Upvotes: 1
Reputation: 5427
No, it is not possible.
It can happen that you have two package of the same name. But that is only possible when:
you terminate rpm during the transaction. You can then remove the correct one using full NEVRA. I.e., rpm -e bash-5.1.8-2.fc35.x86_64
when packages are multilib. I.e., one is i386 and the other x86_64
If you want to keep backups then I recommend either using 'local' plugin https://dnf-plugins-core.readthedocs.io/en/latest/local.html Just be aware that it can consume a lot of storage. Or even Red Hat Satellite, which allows you easy rollbacks. But that is likely big beast for your needs.
Upvotes: 0