Recovering installed packages

I came across an interesting discussion at LQ, about extracting a package from its installation and recovering the installable package. Useful if you want to uninstall something, but are not sure if you may need it in the future.

Thanks to the explanation by Ruarí Ødegaard, it is as actually quite straightforward. I decided to try this for leafpad, that I have installed from SlackBuilds.org — here’s how it went:

$ su -
removepkg -copy leafpad-0.8.18.1-x86_64-1_SBo
cd /var/log/setup/tmp/preserved_packages/leafpad-0.8.18.1-x86_64-1_SBo/
mkdir -p install
grep '^leafpad: ' /var/log/packages/leafpad-0.8.18.1-x86_64-1_SBo > install/slack-desc
makepkg -l n -c n /tmp/leafpad-0.8.18.1-x86_64-1_SBo.tgz

That’s it!
The package is in /tmp. You may want to clean the contents of /var/log/setup/tmp/preserved_packages/ after that.


2 Comments on “Recovering installed packages”

  1. ruario's avatar ruario says:

    Cool, glad you found it useful! Nice blog by the way!

  2. slackalaxy's avatar slackalaxy says:

    Thank you!


Leave a comment