File listing all the manually installed packages?

Bill Mills-Curran bill at mills-curran.net
Sat May 10 01:38:28 UTC 2014


On Fri, May 09, 2014 at 09:41:50PM +0100, Adam Funk wrote:
> Date: Fri, 09 May 2014 21:41:50 +0100
> From: Adam Funk <a24061 at ducksburg.com>
> To: ubuntu-users at lists.ubuntu.com
> Subject: Re: File listing all the manually installed packages?
> Reply-To: "Ubuntu user technical support,
>  not for general discussions" <ubuntu-users at lists.ubuntu.com>
> Precedence: list
> 
> On 2014-05-09, Bill Mills-Curran wrote:
> 
> > On Fri, May 09, 2014 at 02:55:52PM +0100, Adam Funk wrote:
> >> 
> >> Is there a file on an Ubuntu system that I can grep to find all the
> >> manually installed packages?
> >> 
> >> Normally I'd expect grep the output of dpkg or aptitude for this sort
> >> of thing, but the machine in question died; I copied the entire hard
> >> drive onto a USB drive & need the information to make sure I reinstall
> >> Ubuntu (for someone else) on the new machine without anything missing.
> 
> > Have you tried the --admindir option on dpgk-query?  The man page
> > suggests (to me, anyway) that you could access the db from the old
> > disk.
> >
> >        --admindir=dir
> >               Change the location of the dpkg database. The  default
> >               location
> >               is /var/lib/dpkg.
> 
> Excellent!  Unfortunately, AFAICT, dpkg -l doesn't have any way to
> distinguish manually & automatically installed packages, & what I'd
> really like is a list of purely the manually installed ones.  I've
> come across 'aptitude search '!~M ~i' --- is it possible to point that
> at an alternative location for '/var/lib/aptitude/pkgstates', for
> example?
> 
> Thanks,
> Adam
> 

Adam,

I wonder if you could build a list of all packages available in your
distro (apt-cache pkgnames), then use that to weed out what's listed
in dpkg-query -l.  The remainder would be manually installed packages,
right?

Bill




More information about the ubuntu-users mailing list