Debian: Listing all user-installed packages?

后端 未结 9 1997
灰色年华
灰色年华 2021-02-04 03:39

For a cyber security competition I participate in, I\'m given a Debian virtual machine with many packages installed and asked to clean extraneous or malicious packages.

9条回答
  •  眼角桃花
    2021-02-04 04:17

    The following Bash command works for me in Debian 10 (buster). It prints all manually installed packages minus the ones that came from your Debian installation (in other words, the packages that you installed with apt install):

    sudo grep -oP "Unpacking \K[^: ]+" /var/log/installer/syslog \
      | sort -u | comm -13 /dev/stdin <(apt-mark showmanual | sort)
    

    sudo is needed to search through /var/log/installer/syslog. You could also save this installer package list somewhere else if you don't want to use sudo every time.

提交回复
热议问题