Things I ask AI

What Packages are Installed?

I am on Debian flavor. I would like to see a list of packages I have manually installed.

On Debian (and Ubuntu-based systems), the cleanest way is usually:

apt-mark showmanual

That shows packages marked as manually installed rather than pulled in automatically as dependencies.

More useful versions

Only packages currently installed

apt-mark showmanual | sort

Exclude common base/system packages

Sometimes the list still contains a lot of things from the initial install. This filters out packages that came from the installer task selections:

comm -23 \
  <(apt-mark showmanual | sort) \
  <(gzip -dc /var/log/installer/initial-status.gz \
      | sed -n 's/^Package: //p' | sort)

That gives a closer approximation of:

“What did I explicitly install later?”


See installation dates too

grep " install " /var/log/dpkg.log* \
  | grep -v automatic

Or for a readable history:

grep "Commandline:" /var/log/apt/history.log*

This shows the actual apt install ... commands that were run.


If you use tasksel or desktop environments

Be aware:

So the “exclude installer packages” method above is often the most useful.


Export your manual package list for backup/reinstall

apt-mark showmanual > packages-manual.txt

Then later:

xargs -a packages-manual.txt sudo apt install

That’s a common migration strategy between Debian systems.


WARNING: AI can and will make mistakes. It is the user's responsibility to not blindly copy and paste anything from an AI engine into any production environment.