LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-13-2019, 03:32 PM   #1
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,086

Rep: Reputation: 115Reputation: 115
installpkg but in reverse?


has anybody ever had a need to uninstall a package but instead of removepkg just deleting the files have a package tool that moves them to /tmp/[package-name]/ including their required symlinks and runs makepkg back in to a package for reinstalling at a later time

not too often, but once in a while i wished i had something that could do that
 
Old 04-13-2019, 03:59 PM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,203

Rep: Reputation: 200Reputation: 200Reputation: 200
You can write a script that reads the installation file in /var/log/packages
 
Old 04-13-2019, 04:07 PM   #3
LuckyCyborg
Member
 
Registered: Mar 2010
Posts: 424

Rep: Reputation: 205Reputation: 205Reputation: 205
From the manual of removepkg
Code:
       --preserve packagename
              If specified, the complete package subtree is reconstructed in /var/lib/pkgtools/setup/tmp/preserved_packages/packagename.
However, I do not think that it is capable to reconstruct completely packages which contains /etc files which are renamed or have the permissions changed on installation, or they are already tuned by user.

Last edited by LuckyCyborg; 04-13-2019 at 04:08 PM.
 
Old 04-13-2019, 04:17 PM   #4
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,086

Original Poster
Rep: Reputation: 115Reputation: 115
LuckyCyborg, i will give that a try on a non test package to see how well it does, thanks i did not know --preserve was even there, and ya on the modified /etc/ files if it at least saves a copy i can always fix it since i dont do much in /etc unless necessary (if it aint broke, dont fix it)
 
Old 04-13-2019, 04:24 PM   #5
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,086

Original Poster
Rep: Reputation: 115Reputation: 115
Random Troll, can the mv command read those files in /var/log/packages and move the listed files somewhere like /tmp/[package-name] ?

-----

this is what removepkg --preserve did
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2019-04-13_16-21-49.png
Views:	35
Size:	16.1 KB
ID:	30341  
 
Old 04-13-2019, 04:27 PM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 8,831

Rep: Reputation: Disabled
Not an answer to your question, but why not save the package somewhere, if you think it could become unavailable from the servers?
 
Old 04-13-2019, 04:35 PM   #7
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,086

Original Poster
Rep: Reputation: 115Reputation: 115
Didier it might be the answer but it is a solution, but not a solution that is always available, like if i am out camping far away and i dont have internet access, i like the idea that if i can keep an old package archived on my drive somewhere just in case i need it later,

i plan to spend some time in the south west deserts of the USA soon and there wont always be internet access, i think that --preserve option with removepkg will do it
 
Old 04-13-2019, 05:27 PM   #8
LuckyCyborg
Member
 
Registered: Mar 2010
Posts: 424

Rep: Reputation: 205Reputation: 205Reputation: 205
Quote:
Originally Posted by Okie View Post
this is what removepkg --preserve did
Yes, the "--preserve" flag preserves the files on a reconstructed package, WHEN that particular package is removed from system.

Sorry, but I do not know certainly what you intend to do and certainly I do not intend to go the ol' RTFM, however you can see all available options doing "man removepkg"

BTW, if I remember right, another alternative is "removepkg --copy" which reconstruct the package WITHOUT removing it from system.
 
Old 04-13-2019, 11:58 PM   #9
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,203

Rep: Reputation: 200Reputation: 200Reputation: 200
Quote:
Originally Posted by Okie View Post
Random Troll, can the mv command read those files in /var/log/packages and move the listed files somewhere like /tmp/[package-name]
Look for yourself. It has the full file name minus the initial slash. The other options people have mentioned look better. I'm no expert. This doesn't resolve conflicts, i.e., if a file appears in another package.

Because I spent years without an Internet connection I keep a copy of every package I use. You may find makepkg more useful. I just remembered it and have never used it. One would think it could use a package definition.
 
Old 04-14-2019, 04:00 AM   #10
solarfields
Member
 
Registered: Feb 2006
Location: Outer Shpongolia
Distribution: Slackware
Posts: 969

Rep: Reputation: 537Reputation: 537Reputation: 537Reputation: 537Reputation: 537Reputation: 537
Check this post by RuarÝ:
https://www.linuxquestions.org/quest...2/#post5139643
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
installpkg to new root, but touched current files baldzhang Slackware 8 08-16-2017 08:27 AM
Reverse Tunneling / Reverse port forwarding in SSH dynamics Linux - Networking 5 02-07-2017 07:19 AM
Nginx Reverse proxy on a internal apache reverse server ITiger Linux - Software 0 04-25-2014 07:44 AM
[SOLVED] bind reverse zone; no name with reverse lookup deadeyes Linux - Server 3 10-12-2009 09:54 AM
Slackware 8.1: "installpkg" command not working? tigerflag Slackware 5 10-12-2002 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration