Repair package manager files after removing a package physically

Hi, team!
I’ve installed some apps manualy using the rpm install or something like that.

After a while I have deleted these files with the folders physically, but then I realized that I had incorrectly removed the installed packages.

I trying to erase it using these commands:
sudo rpm -e <package> or sudo yum erase <package>
but it fails with an error.

All I have is a couple of missed files using this command:
rpm -Va

Can you please explain is any way to fix this? And how to remove it from cache / lists of rpm, etc.?

Usually, missing package files result in warning messages, but this is not critical to removing RPM packages.
Posting the exact error message can help us better understand the root of the problem and find a solution.

2 Likes

Ok, first, I run this command:
sudo rpm -e Maya2023_64-2023.2-1794.x86_64

then I’ve got this error:

/var/tmp/rpm-tmp.6xsF6x: line 32: /opt/Autodesk/AdskLicensing/12.1.0.7121/helper/AdskLicensingInstHelper: Permission denied
error: %preun(Maya2023_64-2023.2-1794.x86_64) scriptlet failed, exit status 126
error: Maya2023_64-2023.2-1794.x86_64: erase failed

And then I try to remove it by another command:
sudo yum erase Maya2023_64-2023.2-1794.x86_64

Dependencies are resolved.
=================================================
Package       Architecture   Version       Repository   Size
Maya2023_64   x86_64         2023.2-1794   @@System     5.3 G
=================================================

Transaction result
=================================================
Delete 1 Package

Vacant place: 5.3 G
Continue? [d/N]: y
Checking the transaction
Verification of the transaction was successfully completed.
The transaction is being checked
The transaction test was successfully completed.
Execution of the transaction
   Preparation: 1/1
   Running the scriptlet: Maya2023_64-2023.2-1794.x86_64 1/1
/var/tmp/rpm-tmp.k2owPs: line 32: /opt/Autodesk/AdskLicensing/12.1.0.7121/helper/AdskLicensingInstHelper: Access denied
error: %preun(Maya2023_64-2023.2-1794.x86_64) scriptlet failed, exit status 126

Error in PREUN scriptlet in rpm package Maya2023_64
   Check: Maya2023_64-2023.2-1794.x86_64 1/1

Failure:
   Maya2023_64-2023.2-1794.x86_64

Error: Transaction failed
sudo rpm --nopreun -e Maya2023_64-2023.2-1794.x86_64
sudo dnf --setopt tsflags=noscripts remove Maya2023_64-2023.2-1794.x86_64
3 Likes

Seems it works and it erase a record about it somewhere, because now it says:

error: Maya2023_64-2023.2-1794.x86_64 package does not install

But I’ve got another issue when I trying to figure out is the missing files had been erased, so I run another command: rpm -Va and I’ve got a long list with missing files. I attach some files here for example:

missing     /opt/Autodesk/Adlm/FLEXnet/11.16.0.0/bin/FNPLicensingService
missing     /opt/Autodesk/Adlm/FLEXnet/11.16.0.0/bin/install_fnp.sh
missing     /opt/Autodesk/Adlm/FLEXnet/11.16.0.0/bin/toolkitinstall.sh
missing     /opt/Autodesk/Adlm/FLEXnet/11.16.0.0/preparchive_11.16.0.yaa
missing     /opt/Autodesk/Adlm/R25/bin
missing     /opt/Autodesk/Adlm/R25/bin/LMU
missing     /opt/Autodesk/Adlm/R25/bin/LTU
missing     /opt/Autodesk/Adlm/R25/bin/iconengines
missing     /opt/Autodesk/Adlm/R25/bin/iconengines/libqsvgicon.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqdds.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqgif.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqicns.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqico.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqjp2.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqjpeg.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqmng.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqsvg.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqtga.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqtiff.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqwbmp.so
missing     /opt/Autodesk/Adlm/R25/bin/imageformats/libqwebp.so

This means some installed package still owns that path:

sudo rpm -e $(rpm -q -f /opt/Autodesk/Adlm/R25/bin)
sudo dnf remove /opt/Autodesk/Adlm/R25/bin
2 Likes

Perfect. Works well. Thank you for promptness! :grinning: :tada: :partying_face: