File listing all the manually installed packages?

Richard Hector richard at walnut.gen.nz
Sat May 10 08:57:12 UTC 2014


On 10/05/14 08:41, Adam Funk wrote:
> 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?

You could probably do it by chrooting into the root of your backup and
then running aptitude as normal.

root at backup:~# chroot /mnt/backup
backup:/# aptitude search ...

Richard





More information about the ubuntu-users mailing list