How do I remove exactly same stuff I have installed or system have installed with adding support for a language for example? Is there a procedure I can follow? Apt-get remove, autoremove or purge is not what I am looking for, it leaves stuff behind.
I am currently looking into debfoster
, but I hope that I am overseeing something easier and more native.
In this moment I have to restore my system from a snapshot to get it into previous setup, I am working on international application, when I install and uninstall for example Chinese, I will end up with several unwanted fonts that were not there before and it makes my testing pointless.
Update:
To update and clarify my question, I already know that package installations are logged a month ago I asked How to properly remove Chinese support and I found a solution, packages installed including fonts I want to delete are only in /var/log/dpkg.log. I am looking for automation or some tool, that will automate this so I do not have to process logs every time I install and uninstall new language or an application. Apparently Ubuntu has a tiny flaw and it does not uninstall fonts on language removal, I do install a new language and then delete it several times a day for testing, I have a script I made today where I put everything from logs that does not uninstall and I still hope I am reinventing a wheel and there is already some procedure in place that keeps track of what files and other stuff package is touching and making sure it will be deleted on removal.
If you installed "stuff" via a package manager (
apt-get
,dpkg
,synaptic
), it's all logged in/var/log/apt/*
. It's a simple matter of editing to generate theapt-get purge
commands.If you installed "stuff" some other way (
sudo make install
,/usr/bin/cpan
, ...) you have to uninstall it using the same method.To make your life easier in the future, especially if you use the second method, consider installing and using
installwatch
. From theman
page:Application
debfoster
I mention in the question does the trick after all, it just took me a while to figure out how it is used.Generate keepers file, stored in
/var/lib/debfoster/keepers
:This keepers file contains all the currently installed packages, the next time something is installed, just run:
It will start listing all the packages installed from the time last keepers file was generated. Questions will be asked giving 9 options, first 4 are important:
More information
man debfoster
ordebfoster --help
.This actually lists even fonts that are omitted with apt-get autoremove or when uninstalling language packages with Language Settings GUI.
I think that what you call "related" packages are the ones mentioned by apt or apt-get as "additional" packages (upon installation) and as "automatically installed" packages (upon removal).
As far as I can understand from this answer,
sudo apt autoremove
shouldn't leave anything behind if run after your specific program/package has been uninstalled.To see before uninstalling the program what its installation (with apt or apt-get) has brought along - following the linked answer:
First, run
sudo apt autoremove
so that apt starts from a "clean" state.Then, simulate removal of your program/package and take note of the automatically installed packages:
which will give something like
After uninstalling YOUR_PROGRAM, if you prefer, do
instead of
sudo apt autoremove
.As for
debfoster
, if you had it installed and had created the keepers file before installing your program, the simple way to see what additional packages a program brought is with the command