0

Is there an apt-cache, dpkg, or apt command that can show whether a particular package is "automatic" or "manual"? dpkg -s <package> is able to show me whether or not a particular package is installed, but it does not say whether the package is automatically or manually installed.

Flux
  • 505

2 Answers2

2

You want the apt-mark command. Specifically apt-mark showauto and apt-mark showmanual.

For example:

alan@ziggy:~$ apt-mark showauto | head
amd64-microcode
apparmor
attr
bash-completion
bind9-dnsutils
bind9-host
bind9-libs
binfmt-support
binutils
binutils-common
alan@ziggy:~$ apt-mark showmanual | head
accountsservice
acl
acpid
adduser
adwaita-icon-theme
aha
aisleriot
alsa-base
alsa-topology-conf
alsa-ucm-conf
popey
  • 23,667
0

You can do that with the command

apt show <packagename> 2>/dev/null | grep "APT-Manual-Installed"
mook765
  • 15,925