Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I list installed packages?

4 views
Skip to first unread message

Mark Weyer

unread,
Apr 23, 2013, 4:40:02 PM4/23/13
to

The title is imprecise. Actually, the question is: How do I list installed packages except those automatically installed to satisfy dependencies. In aptitude that would be packages marked as "i " but not as "i A". And if there is no command to list this, where in /etc (or whereever) is the information hidden?

Please CC me, I am not subscribed.

Thanks in advance,

Mark Weyer


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20130423211244.GA1911@debian

Rui Miguel P. Bernardo

unread,
Apr 23, 2013, 5:20:01 PM4/23/13
to
Hi Mark,

the following should work, listing only the manually installed packages.

aptitude search '?installed?not(?automatic)' -F %p | sed 's/ //g'
Archive: http://lists.debian.org/CAP1Yx5x6Dz0f5tNZQtbvYVs2A{NzHKwdyD0s...@mail.gmail.com

staticsafe

unread,
Apr 23, 2013, 5:20:03 PM4/23/13
to
On 4/23/2013 17:12, Mark Weyer wrote:
>
> The title is imprecise. Actually, the question is: How do I list installed packages except those automatically installed to satisfy dependencies. In aptitude that would be packages marked as "i " but not as "i A". And if there is no command to list this, where in /etc (or whereever) is the information hidden?
>
> Please CC me, I am not subscribed.
>
> Thanks in advance,
>
> Mark Weyer
>
>

aptitude search '~i' | grep -v 'i A'

That should do the trick.
--
staticsafe
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Please don't top post - http://goo.gl/YrmAb
Don't CC me! I'm subscribed to whatever list I just posted on.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/5176F8F...@staticsafe.ca

staticsafe

unread,
Apr 23, 2013, 5:40:02 PM4/23/13
to
On 4/23/2013 17:11, staticsafe wrote:
> On 4/23/2013 17:12, Mark Weyer wrote:
>>
>> The title is imprecise. Actually, the question is: How do I list installed packages except those automatically installed to satisfy dependencies. In aptitude that would be packages marked as "i " but not as "i A". And if there is no command to list this, where in /etc (or whereever) is the information hidden?
>>
>> Please CC me, I am not subscribed.
>>
>> Thanks in advance,
>>
>> Mark Weyer
>>
>>
>
> aptitude search '~i' | grep -v 'i A'
>
> That should do the trick.
>

For further reference:
http://www.algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ch02s03s02.html

--
staticsafe
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Please don't top post - http://goo.gl/YrmAb
Don't CC me! I'm subscribed to whatever list I just posted on.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/5176FD57...@staticsafe.ca

Cláudio E. Elicker

unread,
Apr 23, 2013, 5:40:02 PM4/23/13
to
On Tue, 23 Apr 2013 23:12:44 +0200
Mark Weyer <ma...@weyer-zuhause.de> wrote:

>
> The title is imprecise. Actually, the question is: How do I list
> installed packages except those automatically installed to satisfy
> dependencies.

> <snip>


aptitude search '~i!~M'


--
EMACS is my operating system; Linux is my device driver.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20130423183...@yeh1.parsec

Chris Bannister

unread,
Apr 23, 2013, 6:50:01 PM4/23/13
to
On Tue, Apr 23, 2013 at 11:12:44PM +0200, Mark Weyer wrote:
>
> The title is imprecise. Actually, the question is: How do I list
> installed packages except those automatically installed to satisfy
> dependencies. In aptitude that would be packages marked as "i " but
> not as "i A". And if there is no command to list this, where in /etc
> (or whereever) is the information hidden?
>
> Please CC me, I am not subscribed.
>
> Thanks in advance,

Not sure, but one way would be looking under
/var/lib/dpkg/info

e.g.

1. cd /var/lib/dpkg/info
2. ls -l a*
3. check the listing, if there are packages you don't think you need
then try "dpkg --purge packagename" if it purges, then no other package
depends on it. Otherwise you'll get a message saying something along the
lines of "package xyz depends on package abc -- not purging"

4. You may want to do "apt-cache show packagename" first, just to make
sure you are not going to purge a package you think you may need.

5. carry on, e.g. ls -l b*
etc,

6. Don't bother with ls -l l* (there are heaps of library packages.)
which most certainly are depended on by other packages.
ls -l la* etc ls -le* etc is one way around this.

7. There is sure to be a better way, but ...

--
"If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the
oppressing." --- Malcolm X


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20130423224539.GF28529@tal

Lars Nooden

unread,
Apr 24, 2013, 2:30:02 AM4/24/13
to
On 04/23/2013 09:12 PM, Mark Weyer wrote:
>
> The title is imprecise. Actually, the question is: How do I list installed packages except those automatically installed to satisfy dependencies. In aptitude that would be packages marked as "i " but not as "i A". And if there is no command to list this, where in /etc (or whereever) is the information hidden?
>
> Please CC me, I am not subscribed.
>
> Thanks in advance,
>
> Mark Weyer

You could also look at the package deborphan. I believe it will give
you the information you are looking for.

deborphan -a

Regards,
/Lars


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/51777B49...@gmail.com

Anthony Campbell

unread,
Apr 24, 2013, 3:30:02 AM4/24/13
to
On 24 Apr 2013, Lars Nooden wrote:
> On 04/23/2013 09:12 PM, Mark Weyer wrote:
> >
> >The title is imprecise. Actually, the question is: How do I list installed packages except those automatically installed to satisfy dependencies. In aptitude that would be packages marked as "i " but not as "i A". And if there is no command to list this, where in /etc (or whereever) is the information hidden?
> >
> >Please CC me, I am not subscribed.
> >
> >Thanks in advance,
> >
> > Mark Weyer
>
> You could also look at the package deborphan. I believe it will
> give you the information you are looking for.
>
> deborphan -a
>
> Regards,
> /Lars

Or 'wajig snapshot':.
Generates a list of package=version for all installed packages

AC

--
Anthony Campbell - a...@acampbell.org.uk
http://www.acupuncturecourse.org.uk
http://www.smashwords.com/profile.view/acampbell
https://itunes.apple.com/ca/artist/anthony-campbell/id73235412






--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/2013042407...@acampbell.org.uk

green

unread,
Apr 24, 2013, 9:50:01 AM4/24/13
to
Mark Weyer wrote at 2013-04-23 16:12 -0500:
> The title is imprecise. Actually, the question is: How do I list
> installed packages except those automatically installed to satisfy
> dependencies. In aptitude that would be packages marked as "i " but
> not as "i A". And if there is no command to list this, where in /etc
> (or whereever) is the information hidden?

If the generated list may be used to restore the package selection,
then you may want to save a list of *all* packages installed ("i"),
then a list of packages *manually* installed (not "i" but not "i A").

If you restore a list containing only packages *manually* installed,
the result will be a different package selection because of variations
in dependency resolution. This happens because of packages that
depend on "foo OR bar", or packages with recommends which were or were
not fulfilled in the original package set.

Following are the commands I use for backup and restore of the package
selection. Please note that I have not needed to use these commands
for some time. In fact, aptitude-create-state-bundle arrived some
time after I implemented this; I have not researched the possibility
of using the state bundle to restore the package state. It is quite
likely that it will do the job better than these commands.

For saving the package state, I use these commands:
# Save aptitude state bundle
aptitude-create-state-bundle state.tar.bz2
# Save a list of all installed packages
aptitude -F "%?p" --disable-columns search \~i >| installed-all
# Save a list of all installed packages with their versions
aptitude -F "%?p=%?V" --disable-columns search \~i >|
installed-all-ver
# Save a list of all automatically installed packages
aptitude -F "%?p" --disable-columns search \~i\~M >| installed-auto

For restoring the package state, I use these commands:
# Install all essential, important, required, or standard packages
aptitude -R --schedule-only install $( aptitude -F "%?p" search \
\!\~i?or(\~E,\~pimportant,\~prequired,\~pstandard) )
# Mark as manually installed all essential, important, required, or
standard priority packages
aptitude -R --schedule-only unmarkauto $( aptitude -F "%?p" search \
\~i?or(\~E,\~pimportant,\~prequired,\~pstandard) )
# Mark as automatically installed all packages that are not essential,
# important, required, or standard priority
aptitude --schedule-only markauto $( aptitude -F "%?p" search \
\~i\!\~E\!\~pimportant\!\~prequired\!\~pstandard )
# Install all the packages in the installed package list (manual +
automatic)
aptitude -R --schedule-only install $( cat installed-all )
# Select specific versions of packages (you may want to skip this
step)
aptitude -R --schedule-only install $( cat installed-all-ver )
# Mark as automatically installed all packages in that list
aptitude --schedule-only markauto $( cat installed-auto )
# Run aptitude, check scheduled actions, and apply
aptitude
signature.asc

Mark Weyer

unread,
Apr 24, 2013, 12:20:01 PM4/24/13
to
On Tue, Apr 23, 2013 at 11:12:44PM +0200, Mark Weyer wrote:
> The title is imprecise. Actually, the question is: How do I list installed packages except those automatically installed to satisfy dependencies. In aptitude that would be packages marked as "i " but not as "i A". And if there is no command to list this, where in /etc (or whereever) is the information hidden?

Thanks to all who replied. It never occured to me that aptitude might be more
than interactive.

Best regards,

Mark Weyer


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20130424171431.GA1909@debian

Andrei POPESCU

unread,
Apr 30, 2013, 4:10:03 AM4/30/13
to
On Mi, 24 apr 13, 08:43:07, green wrote:
>
> Following are the commands I use for backup and restore of the package
> selection. Please note that I have not needed to use these commands
> for some time. In fact, aptitude-create-state-bundle arrived some
> time after I implemented this; I have not researched the possibility
> of using the state bundle to restore the package state. It is quite
> likely that it will do the job better than these commands.

Have a look at apt-clone.

Kind regards,
Andrei
--
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
signature.asc
0 new messages