How-to download all installed packages?
I have a system where I have kept /var/cache/apt/archives clean. Only thing is that sometimes packages disappear from the archives (Im SID) or older versions are desirable. Having gotten a dvd-ram for backup, I would like to now keep those on the dvd-ram.
Question, although, I have used dpkg -l and even pumped that output to a file, how do I take that and use that info to get it into a apt-get install --reinstall -d type script or whatever. There are too many to just use an editor and remove the non-needed info. Thanks. |
Are "dpkg --get-selections" and "dpkg --set-selections" what you want? get-selections outputs to a file, and set-selections reads from it. Then to download you can probably just do about any old action with "apt-get --reinstall -d", like you said. I think it will see all those selections set with dpkg. I haven't personally tried this, but the man pages look like it's close to what you want.
Hope this helps. |
How do I easily remove the "install" or "deinstall" from the file.
|
I think that the output from get-selections is automagically parsed by set-selections, so you shouldn't have to change the format or anything at all if you're using set-selections.
But if you're using the output from that command to give you a list of packages you can directly "apt-get install", I'm trying to find a solution - it seems this sort of works: apt-get --reinstall -d install `dpkg --get-selections | grep -v deinstall | sed -e s/'install'//g` The `dpkg --get-selections | grep -v deinstall | sed -e s/'install'//g` part feeds the list of packages that I believe you're looking for to the apt-get command. When I run this, I'm getting a bunch of errors about the packages not being able to be reinstalled, but I think this is because I already have the dpkg files in my cache folder. I deleted one, but my "php4" package has broken dependencies, so apt can't continue when I try to install that. Anyways, try the above command, let's see what it gives you! |
Thanks, great direction!
In light of your suggestion and after an apt-get update, upgrade, clean cycle, I tried the command line. It returned an error about watch--> that is was part of another package.
I then pumped that output to a file, and simply removed watch (or any other offensive packages in future). Afterwards, I uncommented those entries in my sources.list that were not used currently but needed none the less. Then, Code:
RAVEN:/home/jchap# apt-get --reinstall -t unstable -d install `cat package.list` The kernel-image and kmyfirewall are those packages compiled from source, libdvdcss2 ... Anyway, thanks. I'll have to really study upon the formating commands like grep and sed. This all came about by wanting to create a SID system based upon my packages on another machine. I will keep these files on dvd-ram or dvd-r(w). Dunno yet. Although I found/installed a superior replacement for pixie-plus (showimg), it took a lil time in finding just the right package. If I should find a package has been removed from archives, it may not be removed from mine! Yeah! Thanks again. |
Here is another! apt-cache pkgnames
apt-cache pkgnames does it too without the install, reinstall, deinstall, blah blah blah
Yeah! Still thanks as it put me on right track and those text parsing/formating tools. |
All times are GMT -5. The time now is 05:45 PM. |