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 — here’s how it went:

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

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 says:

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

  2. slackalaxy says:

    Thank you!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s