LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 09-15-2006, 12:12 AM   #1
MrInept
Member
 
Registered: Oct 2005
Location: Melbourne, Australia
Distribution: Debian Etch 2.6.18-(custom compile for k7) with a 72 no 58 no 42 second bootup time (XP=4mins)
Posts: 52

Rep: Reputation: 15
Transfering installed packages on one sys to another


I had a really sweet version of etch running a week ago when i upgraded my hard drive, i've got both the old and new in now but i'm running etch off the new. The thought of figuring out which packages to download again kills me so i'm wondering if somewhere i can grab a list of the installed packages on the old system and do something with it, thoughts?
 
Old 09-15-2006, 01:57 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 32
boot up the old system and run
dpkg --list
pipe it into a file so you can read it whenever you wish
dpgk --list > packagelist.txt

this list will show you all packages and version numbers of the packages installed.

also:
this will show you package name, current version, available version and priority of installed packages:
aptitude -F '%p %v %V %P' search '~i'

this will show you the same as above but for packages to be updated if you run apt-get upgrade:
aptitude -F '%p %v %V %P' search '~U'

read /usr/share/doc/aptitude/README for more info.
 
Old 09-15-2006, 02:29 AM   #3
MrInept
Member
 
Registered: Oct 2005
Location: Melbourne, Australia
Distribution: Debian Etch 2.6.18-(custom compile for k7) with a 72 no 58 no 42 second bootup time (XP=4mins)
Posts: 52

Original Poster
Rep: Reputation: 15
nice, i should really go over all that piping stuff.
 
Old 09-15-2006, 04:04 AM   #4
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 32
in theory you should be able to mount your old system somewhere and simply point apt, dpkg or aptitude to the packages database on that hdd to retreive information :-)
 
Old 09-15-2006, 11:35 AM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
Other than using chroot, how might one "point apt, dpkg or aptitude to the packages database on that hdd"?

In addition to the good advice above, before you destroy the old system, also consider:
Quote:
from man dpkg
dpkg --get-selections [package-name-pattern...]
Get list of package selections, and write it to stdout.

dpkg --set-selections
Set package selections using file read from stdin.
This file should be in the format '<package> <state>',
where state is one of install, hold, deinstall or purge.
Blank lines and comment lines beginning with '#' are also permitted.
...
To make a local copy of the package selection states:
dpkg --get-selections >myselections

You might transfer this file to another computer, and install it there with:
dpkg --set-selections <myselections
Note that this will not actually install or remove anything, but just set the selection state on the requested packages. You will need some other application to actually download and install the requested packages. For example, run dselect and choose "Install".

Ordinarily, you will find that dselect(8) provides a more convenient way to modify the package selection states.
I just tried this on a re-install, unfortunately, dpkg --set-selections <myselections re-installed everything including what I had already done w/ the original CD. Would have taken hours if I hadn't aborted it.

Although I haven't tried it yet, I believe apt-get dselect-upgrade might work better:
Quote:
from man apt-get
dselect-upgrade
dselect-upgrade is used in conjunction with the traditional Debian packaging front-end, dselect(8). dselect-upgrade follows the changes made by dselect(8) to the Status field of available packages, and performs the actions necessary to realize that state (for instance, the removal of old and the installation of new packages).

Last edited by archtoad6; 11-12-2006 at 06:47 PM. Reason: "speling"
 
Old 09-15-2006, 08:39 PM   #6
MrInept
Member
 
Registered: Oct 2005
Location: Melbourne, Australia
Distribution: Debian Etch 2.6.18-(custom compile for k7) with a 72 no 58 no 42 second bootup time (XP=4mins)
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by archtoad6
dselect-upgrade follows the changes made by dselect(8) to the Status field of available packages, and performs the actions necessary to realize that state (for instance, the removal of old and the installation of new packages).
It almost sounds spiritual.
 
Old 09-15-2006, 08:47 PM   #7
MrInept
Member
 
Registered: Oct 2005
Location: Melbourne, Australia
Distribution: Debian Etch 2.6.18-(custom compile for k7) with a 72 no 58 no 42 second bootup time (XP=4mins)
Posts: 52

Original Poster
Rep: Reputation: 15
So anyway seriously, what your saying is i should be able to pipe the state of every package to a file and make dselect just kind of 'make it happen'.

I guess this leaves me one last question, apart from these methods, is there anyway to just transfer everything physically w/o downloading?
 
Old 09-16-2006, 05:28 AM   #8
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
If you have a cd burner then create a cd repository of the packages;

1. Create a new directory /debs under root

2. copy the files from /var/cache/apt/archives to /debs

3. do as root; dpkg-scanpackages /debs /dev/null | gzip > /debs/Packages.gz

4. write the contents of /debs to a cd

6. add the cdrom to the apt sources by doing; apt-cdrom add

5. you can now retrieve the packages you need from the cd using apt-get install

Last edited by TigerOC; 09-16-2006 at 05:56 AM.
 
Old 09-16-2006, 05:33 AM   #9
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 32
Quote:
Originally Posted by Nathanael
in theory you should be able to mount your old system somewhere and simply point apt, dpkg or aptitude to the packages database on that hdd to retreive information :-)
Apologies, i confused this with another packaging system where this is possible!
but chroot is at least something :-)
 
Old 09-17-2006, 02:40 AM   #10
MrInept
Member
 
Registered: Oct 2005
Location: Melbourne, Australia
Distribution: Debian Etch 2.6.18-(custom compile for k7) with a 72 no 58 no 42 second bootup time (XP=4mins)
Posts: 52

Original Poster
Rep: Reputation: 15
I wish that were possible, but as part of tweaking my system i cleared the cached debs, i guess i have no choice but to d/l. Thanks all for your help, you guys (/gals) on this forum rock.
 
Old 09-17-2006, 04:24 AM   #11
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
You could just replicate the old system on the new drive. Here is a howto on this.
 
  


Reply

Tags
debian, package, reinstall, transfer


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
how to save a list of installed packages and install these packages later mandavi Ubuntu 5 09-07-2009 11:36 AM
Sort installed packages by # of dependant packages installed brianez21 Debian 1 01-18-2006 05:06 PM
Is a Linux sys w/o any passwd's as secure as a microsoft windows sys w/no passwd? t3gah Linux - Security 4 04-22-2005 08:01 PM
RPM is saying installed packages aren't installed ticky87 Linux - Newbie 4 07-26-2004 01:17 AM
Upgrading linux computer, transfering HDD w/installed RH9 eddacker Linux - Hardware 1 02-20-2004 04:13 AM


All times are GMT -5. The time now is 11:29 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration