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.
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.
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).
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
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?
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
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.
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!
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.