LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-01-2007, 04:22 PM   #1
mattd7591
Member
 
Registered: Jun 2006
Distribution: Debian Etch
Posts: 92

Rep: Reputation: 15
Transferring packages to new install( debian)


I reinstalled debian to a new hard drive. What I would like to know is if there is an easy way to transfer installed packages from the repository.

Last edited by mattd7591; 04-01-2007 at 04:57 PM.
 
Old 04-01-2007, 05:26 PM   #2
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,692
Blog Entries: 9

Rep: Reputation: 45
Quote:
Originally Posted by mattd7591
I reinstalled debian to a new hard drive. What I would like to know is if there is an easy way to transfer installed packages from the repository.
Depends on what you actually mean by "transfer installed packages from the repository"?

Do you mean how to install packages from the repo or something else ??

regards

John
 
Old 04-01-2007, 05:27 PM   #3
mattd7591
Member
 
Registered: Jun 2006
Distribution: Debian Etch
Posts: 92

Original Poster
Rep: Reputation: 15
Yes, I mean reinstall from the repository
 
Old 04-01-2007, 11:48 PM   #4
sumguy231
Member
 
Registered: Apr 2004
Location: North America
Distribution: Kubuntu 7.04 - Feisty Fawn
Posts: 296

Rep: Reputation: 30
You mean transfer installed packages to the new hard drive? I guess you could probably copy the packages you need from /var/cache/apt/archives and install them with dpkg, but that's probably not worth the effort unless you have little to no Internet connectivity.
 
Old 04-02-2007, 11:36 AM   #5
YaHu
LQ Newbie
 
Registered: Jun 2001
Location: SF Bay Area
Distribution: Debian (right now)
Posts: 28

Rep: Reputation: 15
xfer of Debian packages

Quote:
Originally Posted by mattd7591
I reinstalled debian to a new hard drive. What I would like to know is if there is an easy way to transfer installed packages from the repository.
FWIW, you can copy /var/cache/apt over to your new disk. This will save you from many downloads, though it won't install the packages. (It's like downloading them without installing them.)

N.B.: This doesn't work if you've already updated your system, as two of those files are indexes. In that case you can copy over /var/cache/apt/archives and then install them with, at a guess, dpkg -i *.deb ... though I've always been more selective.


WARNING: While this procedure ought to work when used wholesale, as I've described it here, I've actually only used it on a file or two at a time.
 
Old 04-02-2007, 01:35 PM   #6
mattd7591
Member
 
Registered: Jun 2006
Distribution: Debian Etch
Posts: 92

Original Poster
Rep: Reputation: 15
I thought I mentioned how I deleted some stuff out of /var. But I found a way using dpkg:
1. On machine 1 do:
Code:
dpkg --get-selections > packages.txt

This creates a list of installed, and removed, packages.

2. Do a base install on machine 2

3. Move packages.txt to machine 2

4. On machine 2 do:
Code:
dpkg --set-selections < packages.txt


5. On machine 2 do:
Code:
dselect install


6. Bask in the light of your newly cloned machine.

HTH
 
Old 04-02-2007, 03:50 PM   #7
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Double cool -- You found your own answer & posted it too.

One limitation in your technique: If you are running something old (like SimplyMEPIS 3.3.2) as I am, then your packages.txt will not point to the right vers. of the packages. If, you are, as indeed you are, working w/ a recent ver. of your distro, then this is not a problem.


I believe the "complete" solution, assuming that the old packages are still available somewhere, would be to process the output of dpkg -l to create a custom apt-get install script.

If I want to view my package list, this works:
Code:
COLUMNS=168 dpkg -l  | less -SN#39
The "168" & the "39" are empirical -- "168" makes sure the display is wide enough to see all the name & ver. info., "39" makes nice hor. scrolling in less. YMMV. The "COLUMNS=" is only necessary if you are viewing the output; if you redirect to a file, the formatting is taken care of for you. For example:
Code:
dpkg -l  > dpkg-l.txt
less -S dpkg-l.txt
No info. is lost.


As far as my out of date install is concerned, I plan to upgrade to 6.5 in the near future. It's easier than trying to write that script.

The other approach I have heard suggested, is to never clear your apt cache; in fact, the suggestion was to actively archive it. That way you can copy them (the .debs) to the clone & install them fresh.
 
Old 04-02-2007, 05:02 PM   #8
mattd7591
Member
 
Registered: Jun 2006
Distribution: Debian Etch
Posts: 92

Original Poster
Rep: Reputation: 15
Thanks for that info about the different versions.
That was not a problem as they are both Debian Etch.
 
Old 04-02-2007, 05:22 PM   #9
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
As I expected.

Actually, I was hoping to hear from someone who has done the dpkg -l processing thing.
 
Old 04-02-2007, 05:46 PM   #10
sumguy231
Member
 
Registered: Apr 2004
Location: North America
Distribution: Kubuntu 7.04 - Feisty Fawn
Posts: 296

Rep: Reputation: 30
Wow, cool. I didn't know that.
 
  


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
Can't install packages on Debian Sarge base install Mark_667 Debian 5 01-29-2007 02:40 PM
Cannot install debian packages pafinator11 SUSE / openSUSE 3 09-15-2005 06:55 PM
install debian packages jupiter3437 Ubuntu 2 08-05-2005 12:09 AM
What do you use to install/manage packages on debian? dinojerm Debian 18 07-14-2005 04:27 AM
Debian - Install (Packages) Tech1 Linux - Distributions 8 04-19-2003 06:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:53 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