RPM spec missing uninstall section?
Asked Answered
B

1

10

I see no uninstall section in RPM spec documentation. I do see preun and postun.

  1. Is there uninstall phase?
  2. What exactly happens during uninstall phase? Basing on %files section, a list of files is removed? and that's it?
Bonds answered 1/4, 2015 at 12:15 Comment(1)
On install, the package contents, (the %files information), is added to the system rpm database (generally in /var/lib/rpm). On uninstall, this database information is read by rpm to guide the removal process.Keene
S
20

Correct.

The %install section of an RPM spec file is not run on rpm package installation (the name is misleading in that sense). The %install section is run during package creation to install the files that need to be packaged such that the rpmbuild process can package them up.

As such, as because the %files section lists all the files and directories that the package contains the uninstallation process for an rpm is simply the removal of all the packaged files.

If additional work needs to be done before or after the files are removed the %preun and %postun scriptlets are available in the spec file for that work.

Senhauser answered 1/4, 2015 at 13:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.