SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a couple of packages installed but I lost the packages themselves, and also the specific build scripts. Now I would like to upgrade some of them, but I want to keep an option open to revert back if I run into trouble. Hence my question: How can I reconstruct a package from installed files?
The reason I ask here, is that I expect somebody else to already have run into this issue, and I hope they have a script lying around somewhere. If not, I might have to cook something up by myself...
We need some more specifics. Which packages? Did you use slackbuild scripts? Are they listed in /var/log/packages? Did you install by extracting a 3rd party tar, rpm or deb file?
Hence my question: How can I reconstruct a package from installed files?
removepkg --preserve packagename
From the manpage for removepkg: "--preserve packagename - If specified, the complete package subtree is reconstructed in /var/lib/pkgtools/setup/tmp/preserved_package/packagename."
Once you have the package subtree, you can use makepkg on it to create the package.
I think that is the location on 14.2 and earlier. On -current and future releases like 15.0, the package database has been moved from /var/log/ to /var/lib/pkgtools/.
Thanks very much! This really helps. By the way, package ended up here:
Code:
/var/log/setup/tmp/preserved_packages
Note the 'tmp' in the path. It will not survive a reboot. So if you value the
'preserved' packages, then move them out of that directory.
I submitted a patch set allowing the caller to set the copy/preserve target,
but Pat didn't like it I guess. The set also added --preserve to upgradepkg and
implemented a significant speed-up of copy/preserve.
Note the 'tmp' in the path. It will not survive a reboot.
As far as I know /var/log/setup/tmp/ in 14.x is a real directory (probably unlike -current), not a tmpfs one, so will not be affected by a reboot.
The directory is created - but empty - by the pkgtools-14.2 package.
As far as I know /var/log/setup/tmp/ in 14.x is a real directory (probably unlike -current), not a tmpfs one, so will not be affected by a reboot. The directory is created - but empty - by the pkgtools-14.2 package.
Never noticed that bit in the rc.S startup script before....
To the OP: so you will have to move your generated packages out of the /var/log/setup/tmp tree before rebooting, as the above code will remove all files AND subdirectories in there at bootup.
Last edited by ehartman; 04-09-2020 at 07:14 AM.
Reason: Warning for the OP
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.