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 05-31-2010, 11:29 AM   #1
ultrasawblade
LQ Newbie
 
Registered: Apr 2007
Distribution: Debian
Posts: 15

Rep: Reputation: 0
Getting list of installed packages from a dead system


I have a dead system that was running Debian Linux (lenny). I can boot into emergency mode, but nothing else.

I will likely have to reinstall Debian. I've read lots of things online about how to get a list of currently installed packages. Which is fine and dandy if the system is working and I can log into it. I'm kicking myself in the rear for not doing that on a regular basis.

In my situation, I'm basically wanting to extract such a list from a hard drive containing an installation I can't log into normally. I can access the filesystem just fine, and nothing related to aptitude has been damaged.

Does anyone know where I should look, or where I could look for further information?

Thanks for taking the time to read this and your help.
 
Old 05-31-2010, 11:43 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613
Boot into single user mode, and run
Code:
dpkg --get-selections > /tmp/packages.txt
. Later, feed the text file to dpkg --set-selections.

Failing that, grab a copy of /var/lib/dpkg and do some magic. I'd just have to Google the magic, so you can too.
 
Old 05-31-2010, 12:30 PM   #3
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,734
Blog Entries: 12

Rep: Reputation: 462Reputation: 462Reputation: 462Reputation: 462Reputation: 462
!debian clone

< dpkg> One method of cloning debian installs is to take a current debian machine that is setup with the packages you want.

Run the command

dpkg --get-selections > ~/selectionfile

Then, after the base install on other machines use that file and do:

dpkg --set-selections < ./selectionfile && apt-get dselect-upgrade
 
Old 05-31-2010, 12:59 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.4 + 50+ other Linux OS, for test only.
Posts: 16,746

Rep: Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319
This will work .. and will save an alphabetic package list :

ls /media/disk/var/lib/dpkg/info/ | grep list > list.txt

You will of course have to use the actual path.
..
 
Old 01-14-2016, 01:52 PM   #5
alaric
LQ Newbie
 
Registered: Aug 2003
Location: Amsterdam
Distribution: debian
Posts: 13

Rep: Reputation: 0
The real answer

dpkg --admindir /opt/verylarge/backintime_backup/backintime/sean/root/1/20160109-060001-718/backup/var/lib/dpkg -l

is what you wanted to know. Adding this here for others who were looking for the same thing.
(aka, pass the old /var/lib/dpkg path to dpkg using --admindir).
 
  


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
how to save a list of installed packages and install these packages later mandavi Ubuntu 5 09-07-2009 12:36 PM
Is there a list of all installed packages? AgentD Slackware 6 05-28-2008 02:36 AM
How to list all installed packages? bp12345 Debian 2 08-15-2005 09:06 AM
list of installed packages jeff1500 Slackware 3 03-22-2004 05:52 PM
How do I get a current list of RPM packages installed on my system? needamiracle Linux - General 1 12-06-2002 06:38 PM

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

All times are GMT -5. The time now is 07:00 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration