Discussion:
Question on 'dpkg --get-selections'
(too old to reply)
Marc Shapiro
2020-09-12 05:10:01 UTC
Permalink
Is there any option to have 'dpkg --get-selections' NOT include
automatically installed packages?  Otherwise, all packages show as
manually installed, including those that would otherwise have been
automatically installed.


Marc
Sven Joachim
2020-09-12 07:30:01 UTC
Permalink
Post by Marc Shapiro
Is there any option to have 'dpkg --get-selections' NOT include
automatically installed packages?
No, dpkg has no notion of automatically installed packages, that is an
apt concept.
Post by Marc Shapiro
Otherwise, all packages show as manually installed, including those
that would otherwise have been automatically installed.
You can obtain a list of automatically installed packages with
apt-mark(1):

$ apt-mark showauto > automatically-installed-packages

Then, on the replicated system where you presumably had used
"dpkg --set-selections" to install the same set of packages:

# apt-mark auto $(cat automatically-installed-packages)

HTH,
Sven
Toni Mas Soler
2020-09-12 10:00:02 UTC
Permalink
I do this job using aptitude instead apt:
/usr/bin/aptitude search '~i !~M' -F '%p' --disable-columns

Toni Mas
Post by Sven Joachim
Post by Marc Shapiro
Is there any option to have 'dpkg --get-selections' NOT include
automatically installed packages?
No, dpkg has no notion of automatically installed packages, that is an
apt concept.
Post by Marc Shapiro
Otherwise, all packages show as manually installed, including those
that would otherwise have been automatically installed.
You can obtain a list of automatically installed packages with
$ apt-mark showauto > automatically-installed-packages
Then, on the replicated system where you presumably had used
# apt-mark auto $(cat automatically-installed-packages)
HTH,
Sven
Marc Shapiro
2020-09-16 02:40:03 UTC
Permalink
Post by Sven Joachim
Post by Marc Shapiro
Is there any option to have 'dpkg --get-selections' NOT include
automatically installed packages?
No, dpkg has no notion of automatically installed packages, that is an
apt concept.
Post by Marc Shapiro
Otherwise, all packages show as manually installed, including those
that would otherwise have been automatically installed.
You can obtain a list of automatically installed packages with
$ apt-mark showauto > automatically-installed-packages
Then, on the replicated system where you presumably had used
# apt-mark auto $(cat automatically-installed-packages)
HTH,
Sven
Thank you.  That is a perfectly acceptable solution to the issue.

Marc

Loading...