When wanting to completely remove a built-from-source program: is there any way one could see which packages were installed as dependencies and easily remove them?

Note that I mean the packages that were missing (and therefore, had to be installed) when building said program. I wouldn't want to remove all dependencies, since another package could depend on them.

  • 3
    If you built the program from source, you probably installed dependencies to get the program to compile and run. If you made no note of what you installed, then there is nothing keeping track of what was installed as a dependency of the program and what was already installed prior to you starting to look into compiling the program.
    – Kusalananda
    Jul 28, 2021 at 14:00

1 Answer 1


If you're using debian or some other distro that uses .deb packages, you can look in /var/log/dpkg.log to find out which packages you manually installed around the time you compiled the program (note that the logrotate package rotates dpkg.log every month and only keeps the last 12 months worth of the log file).

Once you have the list of packages, you can manually uninstall them with dpkg or apt.

I expect rpm-based distros will have a similar log file for you to examine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .