LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-01-2007, 02:42 PM   #1
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
Post Is there a file that lists all installed packages in Ubuntu


Hi there,

The other day I had a hard drive failure. I'm trying to rescue what information I can off the failed drive using another computer before reinstalling (on a new drive, of course). I can't boot into the installation on the failed drive, otherwise I would use dpkg --list, so I am wondering if there is a log file anywhere in Ubuntu that tells me which packages were installed. Under Slackware, if I remember rightly, there is a complete list of installed packages under /var/log/packages, I'm looking for something similar to that.

This isn't too important, if I can't get a list of the packages I had installed it's not the end of the world, no doubt I'll notice if there's one missing after reinstallation that I realise I want to use! I'm just curious about this, and I wasn't able to find the answer by doing a web search.

By the way, before anyone says it, I did keep backups, there shouldn't be any data loss, it's just going to be annoying reinstalling and reconfiguring everything (even if it is mostly just a case of copying in the old conf files).

Thanks for any assistance!
 
Old 11-01-2007, 03:33 PM   #2
waylandbill
LQ Newbie
 
Registered: Jan 2006
Posts: 4

Rep: Reputation: 0
Use dpkg

dpkg --get-selections > ~/installed_packages

would do the trick.
 
Old 11-01-2007, 03:44 PM   #3
wit_273
Member
 
Registered: Mar 2007
Location: Nebraska
Distribution: CentOS
Posts: 82

Rep: Reputation: 15
The status of packages are in /var/lib/dpkg/status This will tell you what is installed marked to be installed/uninstalled and other package status.
 
Old 11-01-2007, 04:10 PM   #4
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Original Poster
Rep: Reputation: 32
Thanks wit_273! waylandbill, thanks for the tip but as I said I can't actually boot into the install on the failed drive, so I couldn't use dpkg.
 
Old 11-01-2007, 04:44 PM   #5
phantom_cyph
Senior Member
 
Registered: Feb 2007
Location: My HDD...
Distribution: WinXP for designing, Linux for life.
Posts: 2,329
Blog Entries: 1

Rep: Reputation: 47
Or, open synaptic package manager (enter root password) and click on "installed packages".
 
Old 11-01-2007, 04:47 PM   #6
complich8
Member
 
Registered: Oct 2007
Distribution: rhel, fedora, gentoo, ubuntu, freebsd
Posts: 104

Rep: Reputation: 15
just fyi, even if you can't boot the disk, it may be possible to mount it and chroot into it from a working disk (either livecd or the working disk)...

but yeah, what wit said
 
Old 11-02-2007, 09:47 AM   #7
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
Since you say it isn't important, you probably don't want to do this, but if you were to run SpinRite on the failed drive, you probably would get it back to a usable state for at least a short time. This would give you time to get your data off, or maybe even enough time to image the drive.
 
Old 11-02-2007, 06:38 PM   #8
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Original Poster
Rep: Reputation: 32
It's not important enough to me to justify spending the license fee for SpinRite, but thanks for the suggestion. The wikipedia page on SpinRite also mentioned ddrescue, which I hadn't heard of before and is free, so that might be worth looking into if necessary. I think I've managed to get all the important data off the drive now though, apart from configuration data nearly all of it was in the last backup I took before the drive failed.

Thanks again to everyone.
 
Old 11-03-2007, 09:58 AM   #9
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
I don't think that ddrescue does the same thing as spinrite in one critical area. Ddrescue doesn't abort on I/O errors, but it also doesn't do much of a job of trying to read the block that has the error. IF it can't read it, it'll just fill it in with something in the output file.

Spinrite will read the damaged block over and over, and perform a statistical analysis of the data it reads in, attempting to reconstruct the real data that is in the block. More often than not, this works - although it can take a long time. If it recovers the data, it remaps the drive to remove the bad block and puts the data into one of the drive's spare blocks.

Sometimes after recovering the data, it then can rewrite that block, and test it, and find it to be OK. In this case it will then restore that block to the "active" list.

Presuming the heads move and the platter spins, it has been my experience that usually spinrite will return the drive to a serviceable state. If the drive is failing, the drive won't remain serviceable for long but it usually will last long enough to get the data off (perhaps with ddrescue). If the drive, for instance, experienced a soft head crash (like when one of your kids is playing, slips and falls, and knocks over the computer) then spinrite will save your bacon, recovering the drive with no data loss. If such an event didn't do hardware damage to the HD, you can just keep on going.

I do not know of any other product that can do this, and I have to say that it has been an invaluable tool for me.
 
  


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
Running newest Ubuntu, just installed and having errors upgrading packages fatenabu Ubuntu 1 06-01-2007 06:09 PM
Ubuntu: What packages installed? endfx Linux - Software 1 05-24-2006 04:26 PM
apt-get upgrade lists many packages kept back malbery Debian 2 01-05-2005 01:15 PM
Swaret lists no packages 2Gnu Slackware 8 03-17-2004 01:01 PM
Where is the file:lists all installed pkg's-like 'pkgtool-view'? BearClaw Slackware 2 07-19-2003 10:06 AM


All times are GMT -5. The time now is 08:37 PM.

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