LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 08-10-2010, 05:08 PM   #1
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
Slackpkg question....


So, I need to know if there is a way to command slackpkg to reinstall
all installed packages...?

I dont think there is but also wanted to know if I could somehow
edit scripts, etc to enable this

I made a template doing

Code:
slackpkg generate-template Mini
I then tried to run it and of course it says

Quote:
All packages from Mini template are already installed
I need this because as many know here I make variations of livecd's
and I have injured one of my installs when I ran a script that I shouldn't have and it deleted several directories under /etc
usr/lib and /usr/bin
I have no idea exactly what was deleted and thus I wish to reinstall all
installed packages
There must be a way to do this without the borish method of manually reinstalling hundreds of pkgs

Is there a way to grep /var/log/packages and say reinstall all?
thx
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 08-10-2010, 05:45 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
If you are trying to reinstall all the packages...why not just reinstall Slackware? You can backup /home so your user configuration is saved (better yet, perhaps you already put /home on it's own partition).
 
1 members found this post helpful.
Old 08-10-2010, 05:58 PM   #3
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by linus72 View Post
So, I need to know if there is a way to command slackpkg to reinstall
all installed packages...?

I dont think there is but also wanted to know if I could somehow
edit scripts, etc to enable this

I made a template doing

Code:
slackpkg generate-template Mini
I then tried to run it and of course it says



I need this because as many know here I make variations of livecd's
and I have injured one of my installs when I ran a script that I shouldn't have and it deleted several directories under /etc
usr/lib and /usr/bin
I have no idea exactly what was deleted and thus I wish to reinstall all
installed packages
There must be a way to do this without the borish method of manually reinstalling hundreds of pkgs

Is there a way to grep /var/log/packages and say reinstall all?
thx
How about...
Code:
echo "a ap d e f k kde l n t tcl x xap y" > /tmp/stuff
slackpkg reinstall /tmp/stuff
 
1 members found this post helpful.
Old 08-10-2010, 06:07 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,241

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
Save a line.

Code:
echo "a ap d e f k kde l n t tcl x xap y" | xargs -i slackpkg reinstall {}
EDIT: PLEASE keep in mind that I haven't tried this.

Last edited by dugan; 08-10-2010 at 06:21 PM.
 
2 members found this post helpful.
Old 08-10-2010, 06:17 PM   #5
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
dugan, I think that your method will run slackpkg 14 times; using the actual file will only run it once.

That's a really neat trick though. I'll keep it in mind for other uses.
 
1 members found this post helpful.
Old 08-10-2010, 07:08 PM   #6
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
I may try that dugan as many of my installs are functioning retarded anyway...

I think it may work as looking at term after running it
Code:
echo "a ap d e f k kde l n t tcl x xap y" | xargs -i slackpkg reinstall {}
seems it correctly will reinstall all..except I unmarked slackpkg of course

here we go....
 
Old 08-10-2010, 07:29 PM   #7
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
OK
I ran that above and although it went thru the motions of reinstalling everything there are no .new files anywhere?
and var/cache/packages is empty of pkgs; shouldn't it be full?

EDIT:
update; it didn't actually reinstall anything and although the term showed slackpkg downloading and reinstalling everythin it didnt do anything...lol
how do I make it work for real?
or why is it not working?

Last edited by linus72; 08-10-2010 at 07:32 PM.
 
Old 08-10-2010, 07:40 PM   #8
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by linus72 View Post
OK
there are no .new files anywhere?
If the *.new file is the same as the old one, Slackware deletes it.
Here's the code in the doinst.sh script:
Code:
config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}
Quote:
Originally Posted by linus72 View Post
and var/cache/packages is empty of pkgs; shouldn't it be full?

No, by default Slackpkg automatically deletes the downloaded packages after it's done with them. You can change that by setting 'DELALL=off' in /etc/slackpkg/slackpkg.conf

Last edited by piratesmack; 08-10-2010 at 07:49 PM.
 
1 members found this post helpful.
Old 08-10-2010, 08:01 PM   #9
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: Slack14.2/Many
Posts: 5,573

Original Poster
Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
OK
then I guess it did work as some things like pkgtool which weren't working seem to be working...
this should be added to slackpkg somehow...so SOLVED I would say!
Thanks everyone/Richard/Dugan!
you guys are sub-genius!

yeah I got new mail /var/mail/root

Last edited by linus72; 08-10-2010 at 08:29 PM.
 
Old 08-10-2010, 10:39 PM   #10
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
I haven't tried this but why not do

Code:
slackpkg reinstall a ap d e f k kde l n t tcl x xap y
Instead of messing about with files and xargs? Does it work?
 
1 members found this post helpful.
Old 08-11-2010, 02:32 AM   #11
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 519

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by dive View Post
I haven't tried this but why not do

Code:
slackpkg reinstall a ap d e f k kde l n t tcl x xap y
Instead of messing about with files and xargs? Does it work?
Yeah, no need to use xargs here.

xargs would be useful for something like:
Code:
# find all packages that end with a build number (unofficial packages
# usually end with a tag) EXCEPT for aaa_elflibs and pass them as args
# to 'slackpkg reinstall'
ls /var/log/packages/ \
  | grep '[1-9][0-9]*$' \
  | grep -v '^aaa_elflibs' \
  | rev \
  | cut -d- -f4- \
  | rev \
  | xargs slackpkg reinstall
Note: Just an example, don't really use this. The other command is better I think.

Last edited by piratesmack; 08-11-2010 at 02:57 AM.
 
1 members found this post helpful.
Old 08-11-2010, 07:13 AM   #12
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by dive View Post
I haven't tried this but why not do

Code:
slackpkg reinstall a ap d e f k kde l n t tcl x xap y
Instead of messing about with files and xargs? Does it work?
The slackpkg man page was rather vague in its explanation of PATTERN on the command line. The man page stated rather plainly that a file containing many patterns would work. I pointed the OP to a solution that I was very confident would work versus one for which I wasn't. That's all.
 
1 members found this post helpful.
  


Reply



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
[SOLVED] Bash Script Question / Slackpkg smoooth103 Slackware 5 05-17-2010 12:55 PM
slackpkg question Akheron Linux - Newbie 3 06-07-2009 01:20 PM
Slackpkg upgrade question chocloman Slackware 5 05-01-2007 01:28 PM
fluxbox and slackpkg question YBA^[x] Slackware 4 12-22-2004 12:58 PM
slackpkg question ralvy Slackware 2 11-19-2004 04:48 PM

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

All times are GMT -5. The time now is 07:24 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
Open Source Consulting | Domain Registration