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

Notices


Reply
  Search this Thread
Old 12-18-2004, 11:59 PM   #1
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Rep: Reputation: 30
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.
 
Old 12-19-2004, 06:09 PM   #2
corfe
Member
 
Registered: Dec 2004
Location: Washington State, USA
Distribution: Debian Sid
Posts: 128

Rep: Reputation: 16
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.
 
Old 12-19-2004, 06:49 PM   #3
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Original Poster
Rep: Reputation: 30
How do I easily remove the "install" or "deinstall" from the file.


Last edited by Outabux; 12-19-2004 at 07:06 PM.
 
Old 12-20-2004, 12:31 PM   #4
corfe
Member
 
Registered: Dec 2004
Location: Washington State, USA
Distribution: Debian Sid
Posts: 128

Rep: Reputation: 16
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!
 
Old 12-22-2004, 02:06 PM   #5
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Original Poster
Rep: Reputation: 30
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`
Reading Package Lists... Done
Building Dependency Tree... Done
Reinstallation of kernel-image-2.6.9-pristine+adk is not possible, it cannot be downloaded.
Reinstallation of kmyfirewall-0.9.6.2 is not possible, it cannot be downloaded.
Reinstallation of libdvdcss2 is not possible, it cannot be downloaded.
The following NEW packages will be installed:
  check
0 upgraded, 1 newly installed, 774 reinstalled, 0 to remove and 0 not upgraded.
Need to get 612MB/612MB of archives.
...
Somehow I got check in there...will have to check on that. Otherwise, great!
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.

Last edited by Outabux; 12-22-2004 at 02:08 PM.
 
Old 12-22-2004, 03:09 PM   #6
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian.
Posts: 241

Original Poster
Rep: Reputation: 30
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.
 
  


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
Download New Packages Automatically? Kenji Miyamoto Slackware 7 05-23-2005 02:15 PM
RPM is saying installed packages aren't installed ticky87 Linux - Newbie 4 07-26-2004 02:17 AM
Download all packages from one place muczy Linux From Scratch 3 06-17-2004 02:29 AM
Download packages from cds /home/kyle Linux - Software 3 03-10-2004 01:57 PM
Mplayer - Which packages to download? madlinux VectorLinux 5 02-09-2004 05:40 PM

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

All times are GMT -5. The time now is 12:33 PM.

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