apt-mark showmanual
lists a lot of packages for me:
root@hcompneu:~# apt-mark showmanual | wc -l
4013
root@hcompneu:~# apt-mark showmanual | head
a11y-profile-manager-indicator
abiword
abiword-common
abiword-plugin-grammar
account-plugin-facebook
account-plugin-flickr
account-plugin-google
account-plugin-identica
account-plugin-twitter
accountsservice
root@hcompneu:~# apt-mark showmanual | tail
yelp-xsl
zeitgeist
zeitgeist-core
zeitgeist-datahub
zenity
zenity-common
zip
zlib1g
zlib1g-dev
zlib1g:i386
As I understand, it should only list those packages which I manually installed. I don't remember in each case anymore but I'm pretty sure I did not install all of those manually. Actually, I rarely installed any software on this system, despite Chrome, OpenOffice and some other very basic things. So I would expect a list of maybe 10-100 packages but not more. Maybe it also includes ubuntu-desktop, grub and linux or so from the base Ubuntu installation.
Maybe in the past though I wrote some scripts to fix up a broken system by automatically calling apt-get install XXX
on various packages. Or maybe I did other things. I don't really remember anymore.
Could that be the case here? So I somehow messed it up? If that is the case, what would you suggest? Mark all to automatically installed, and then by hand add some selected packages like ubuntu-desktop?
Or is such output correct and I understand it wrongly? I read this and I'm not sure. It looks like it is much more complicated to get the list of manually installed packages? Or why is the answer so complicated?
Or is apt-mark showmanual
buggy?
root@hcompneu:~# ls -ld /var/log/installer/
drwxr-xr-x 2 root root 4096 Dez 27 11:27 /var/log/installer/
root@hcompneu:~# grep -r cdrom /etc/apt/ --include=*.list
root@hcompneu:~# dpkg -l | grep ^ii | wc -l
3812
TL;DR No, your system is not messed up. Moreover, you can leave all things as they are, so in the current state.
Let's consider three systems:
dpkg -l | grep ^ii | wc -l
apt-mark showmanual | wc -l
Notes:
sudo apt-get install ubuntu-mate-desktop^
. This installation of task package causes all such packages to be marked as manually installed and thus protects them from removal. All other software were installed manually during life-span of the both systems.I tried to conduct some research with fresh installations of old and new systems. Below is the table about clean installations of ordinary Ubuntu desktop ISOs.
dpkg -l | grep ^ii | wc -l
aptitude search '~i!~M' | wc -l
apt-mark showmanual
We can understand here that functionality of Ubiquity installer and APT by itself have changes over time.
From the above table we can see that old systems have huge numbers of manually installed packages from their day 0 of installation.
Newer Ubuntu versions have smaller numbers, this ease their maintenance. They probably have more meta-packages installed which prevent package removal because of dependencies.
Another experiment I have done: I upgraded fresh Ubuntu installation from 8.04 LTS to 10.04 LTS → 12.04 LTS → 14.04 LTS → 18.04 LTS → 20.04 LTS and in the resulting 20.04.3 LTS system I have 1867 manually installed packages of 2913 total packages.
The "manual" installation status of package prevents its removal, so you should not set package as auto-installed.
Good resources to read:
Chapter 2. Debian package management of Debian Reference.
man apt-mark
locally or online, the below quote is essential:The output of the showmaual option includes any package that ever got updates, so not really what you want. The below command I copied from some other answer (don't recall where or I'd attribute it), and compares the output against the initial install list, producing the packages you installed yourself. Put it into a file in your bin area for convenience.
The first time I ran apt-mark showmanual, I knew the list was too big because things like "tar" were included, which I knew I had never manually touched. "tar" however had had an update applied, which caused it to be output. Since "tar" was included in the initial system packages, it gets removed by the script, just leaving things that "showed up" after the initial system installation.
The system is not "messed up", but basically your understanding of what manually installed means is incorrect. A package is never actually marked manual or not-manual. It can only ever be marked auto or not-auto.
A package is marked auto when it is installed automatically to satisfy a dependency. This means that it can (and implies that it should) be removed automatically when no other package depends on it any longer.
On a normal desktop system the majority of packages are installed when the OS is first installed by the installer. These packages have to be installed not-auto, or else they would be removed because nothing depends on them.
Take for example 'abiword' near the top of your list. This is a word processor that is probably quite normal to have installed on a desktop system. I assume that you used one of many flavours of desktop installers. It probably didn't ask you specifically if you wanted abiword. You probably didn't install abiword yourself by name. You still chose to have it by choosing the install medium that you used.
Since there is no other package on your system that depends on you having abiword installed in order to work, it cannot be marked auto or else it would be removed. This means it is not marked auto.
apt-mark showmanual
lists the packages that are not marked auto.Note also that many installers install everything non-auto even if they could mark them auto because something depends on them. Even the important core packages that hundreds of things depend on get marked non-auto. In this sense, maybe the installer is "messsed up", but it is nothing special about your system.
My best attempt at getting a list of things I might have installed myself is:
To exclude packages that are depended on, use:
According to the man-page of
apt-mark
all dependencies of meta-packages are marked asmanual
. So you can run:to mark all of these packages as auto. After that,
shows less packages.