Results 1 to 3 of 3

Thread: How do I get a list of installed packages on a non-root disk?

  1. #1
    Join Date
    Aug 2008
    Location
    UK
    Beans
    2
    Distro
    Ubuntu 8.04 Hardy Heron

    How do I get a list of installed packages on a non-root disk?

    I have an Ubuntu 8.04 (Hardy) system which has crashed, the root disk is no longer bootable or even readable -- but its backup (a straight file-by-file (over rsync) copy) is readable (but not bootable). How can I get from that a list of which packages were installed?

    I know that I can get a list of installed packages on a running system using dpkg -l | grep ^ii, but in this case I suspect that what I need is the file/directory underlying that data. Or a way to point dpkg at the data on the other disk. If it is in text format (and an old memory from early Debian days suggests that it may be) I can then run it through a Perl script to turn it into apt-get commands for the rebuilt system to get it to the same (or equivalent) state.

    Thanks for any pointers...
    Last edited by keris; March 30th, 2009 at 03:45 PM.

  2. #2
    Join Date
    Nov 2006
    Location
    Wisconsin, USA
    Beans
    920
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How do I get a list of installed packages on a non-root disk?

    I'd try dpkg --admindir=/mount/path/to/var/lib/dpkg --get-selections

  3. #3
    Join Date
    Aug 2008
    Location
    UK
    Beans
    2
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How do I get a list of installed packages on a non-root disk?

    Quote Originally Posted by lemming465 View Post
    I'd try dpkg --admindir=/mount/path/to/var/lib/dpkg --get-selections
    Thanks. It was particularly the location (/var/lib/dpkg) which I hadn't found, and the --get-selections (and its reverse --set-selections) which I suspect I never knew. List of packages now extracted and in a safe place waiting until I get a new motherboard and disk to rebuild the machine...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •