Hi all!
The reason for this post is to present a little advice for those who are very meticulous in the installation or removal of on your system. In distributions like Debian and derivatives (Ubuntu, Linux Mint, elementaryOS, ...), who use apt, there is a file that keeps track of everything that is installed or removed from our PC. And that is what we are going to try to show today.
It often happens that we install that is useful to us at some point and that later we want to eliminate. We can do it (apart from using graphic programs) with the command:
$ sudo apt-get remove --purge nombredelsoftware
With this we delete the program in question and, if it is the case, apt It informs us that there are packages that are no longer necessary and we can eliminate with the command:
$ sudo apt-get autoremove
As you already know, with these two simple steps we eliminate the application and its dependencies. However, there are cases in which something we have installed does not come out as a direct dependency or apt decides not to delete. Why? Good question! Although I have my theories, I am not in a position to formulate a satisfactory answer.
Without going any further, today I have performed the installation (in Linux Mint) of mint-meta-xfce4 for testing and later deleting this package (and what I could remove with apt-get autoremove), I have been able to observe that not everything that I had put in a few hours before was going to be deleted. So, as in GNU / Linux we have the wonderful files .log, I have found one that has total control of everything that is installed or uninstalled from the system. To view this file, just open a terminal (or directly from the file explorer) and enter:
$ cat /var/log/apt/history.log
And we will get a screen output similar to this:
As you can see, in this archive all installation or uninstallation operations are reflected. In this way, those of you who have space problems and / or like to have the minimum necessary packages (often bordering on the TOC) you can take a more exhaustive control of apt.
Simple and a single command line from us!
Is the command "sudo apt-get remove –purge" not the same as doing "sudo apt-get purge"? In any case, you could have used the –purge in «sudo autoremove –purge» and there you made sure to leave everything very clean.
by the way in the new apt I suppose it will be "sudo apt purge" ¿?
Sephiroth, I am new to linux. I did not understand what you say in the end. So to give any command, it is not necessary to write "sudo apt-get ..." with sudo apt ____ "is it enough?
Sephiroth refers to the new version of apt. At the moment, as far as I know, nobody has put the new version. At least in Linux Mint it is not.
You can read more about it in this blog: https://blog.desdelinux.net/apt-llega-a-su-version-1-0-con-barra-de-progreso-al-instalar-paquetes/
the new apt is available in ubuntu 14.04 and i guess debian testing too
Indeed, it seems that version 1.0.1 is available in Debian testing. Even so, in Xubuntu 14.04 that I installed to a relative I think it is not there because I did not notice a change in apt. In fact, I updated as usual: apt-get update && apt-get upgrade.
Mysteries of life or maybe an update remains to be installed.
Thanks for the information!
As I have told @ Argen77ino I use that command by tradition. At the end of each update or uninstall I always do a:
sudo apt-get clean && sudo apt-get autoclean
With this you delete the files that have been downloaded, freeing up disk space. For fast internet connections I think it is a good idea, since it costs nothing to download the packages again.
A greeting!
Don't forget about Gentoo.
In / var / db / pkg / you can find the entire database by categories, then by packages of how they were compiled, at what time. What does genlop use
And in /var/log/portage/elog/summary.log are those very important messages that I would say are mandatory to read.
This is the end of this brief culural brief, in case anyone will help you.
Very good note!
I haven't included it because I've always used Debian (and derivatives) and Arch Linux (and derivatives). I have to install Gentoo with a friend and get it ready on a PC other than the main one.
Thanks for the info!
Very good tip for those who want to know everything that happens in their system like me.
I think in older versions of apt if you used –purge and for some strange reason everyone reuses the change. It's the same anyway. They already know for tastes colors.
The truth is that maybe there is a better option, but I have always used that one. As you say, the safest thing is that it is by tradition.
A greeting!
Linked question. To achieve a result equal to that obtained with: # apt-get –purge autoremove [package-name] How should we use Pacman or Zypper? . Thank you.
Someone correct me if not.
When I was using Arch Linux a few years ago I think I was using the command:
sudo pacman -Rsn packagename
If I remember correctly:
The "R" deleted the package in question, the "s" deleted its dependencies and the "n" its configuration files.
In Zypper or YUM no idea, since I have never used them.
A greeting!
Excellent information… Thank you .. GREETINGS
I'm glad it's helpful!
A greeting!
The next step would be to uninstall the packages that we find that were installed but not uninstalled?
Right.
That file lists everything that has been installed and orders it by date. If you find something you don't want to have, a simple:
apt-get remove packagename
And ready!
I'm going to try it to see what I get
Thanks, it will be useful 🙂
That is interesting, but for me for another reason, sometimes I install so many things that I no longer know that xD installs.
But what you mention that apt-get sometimes does not want to delete packages, it does not happen to me because in reality what I use is aptitude. (Both to install and uninstall.)
Greetings.
eee because it says that I use chrome !!! Chromium is what I have, and I don't even know why I'm using this ... damn pages that require the latest version of flash ...