Clean up our system

One of the benefits that we are invited to use GNU / Linux is that it is not filled with garbage, because this is not true, the difference is that this garbage does not slow down the system, or at least it did not seem to me to happen on my computers, but despite that I like to clean it every so often and then I share what I do.

debfoster

The objective of this program is to show the packages that have NOT been installed as dependencies, and a list will be displayed indicating the "held" packages.

Its use is quite simple, when we run it for the first time it will ask us a series of questions about the installed packages.
We can choose to keep the package (it will be remembered by debfoster) or we can choose to delete it.

If when answering one of the questions we have any questions about the package, we can type «?» to be able to view information about it.

In my case there were quite a lot, seriously, many questions about the packages that I should or should not remove

Deborphan

This package generates a list of the orphaned packages on the system. By orphan package we understand those libraries that are no longer necessary, that is, no installed package indicates it as a dependency. But… pay attention to programs compiled from sources (with make install or checkinstall) since their dependencies will not be controlled, so that we could cause some malfunction.

Una interesting option is –Libdev, which generates a list with the development libraries (which end with -dev) not necessary.
To see the orphaned packages, just launch the command

# deborphan
o
# deborphan –libdevel

It is possible to do that apt-get read the list of packages generated by deborphan:

# aptitude --purge remove `deborphan`
# aptitude --purge remove `deborphan --libdev

The –purge option as we already know removes the package configuration files.
For the little console lovers we can install gtkorphan, which is a very easy and intuitive graphical interface for deborphan.

By deleting the configuration files we free up space on our disk (sooner or later very valuable) and we keep the / etc directory clean. With the following command we can delete the configuration files that have been left behind by uninstalled packages without the –purge option.

# dpkg --purge `COLUMNS=300 dpkg -l | egrep "^rc" | cut -d' ' -f3`

Other forms:

Clear cache of installed applications:

sudo aptitude clean

Clean uninstalled apps

sudo aptitude autoclean

Clean possible dependencies of uninstalled applications:

sudo aptitude autoremove

Remove old kernels

First we must determine which kernel versions we have installed on our system.

dpkg --get-selections | grep linux-image

Once we take note, we will uninstall (deleting the configuration files) the unwanted kernels

sudo aptitude remove --purge linux-image-X.X.XX-XX-generic

Where we must replace the "X" with the kernel version that we want to uninstall.

Note that we only need superuser powers to remove kernels, not to search for them.

PPA_PURGE

Many times by adding PPA repositories in Ubuntu, we end up with an unstable system, with dependency errors or that takes a long time to search for all the updates that appear.
A solution is to clean the repositories from that list that give us problems or are obsolete.

grep -i ppa.launchpad.net /etc/apt/sources.list.d/*.list > listappa.txt

With this command we create a text file with the complete list.

ppa-purge is a script that easily removes such repository entries and public keys. Another advantage of the script is that the programs that we would have installed with those repositories, the script itself is responsible for trying to replace the packages with their corresponding ones from the official Ubuntu repositories. Whenever possible.

Since Ubuntu 10.10 it is available for installation from the official repositories.

sudo aptitude install ppa-purge

To use it we have in the .txt file that we generate the following

/etc/apt/sources.list.d/wrinkliez-ppasearch-lucid.list:deb http://ppa.launchpad.net/wrinkliez/ppasearch/ubuntu lucid main

What interests us is to delete "wrinkliez / ppasearch"

sudo ppa-purge ppa:wrinkliez/ppasearch

I thought to add localepurge, but it is already in the following link
https://blog.desdelinux.net/ahorra-cientos-de-mb-en-tu-ordenador-con-localepurge/

This is what I normally use, graphic applications I don't use, previously I used ubuntu tweak but no longer.
Greetings.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   frame said

    gtkorphan to do it graphically

    pd: dpkg –purge `COLUMNS = 300 dpkg -l | egrep "^ rc" | cut -d '' -f3` gives me an error on debian wheezy

    dpkg: error: –purge requires at least one package name as an argument

    Type dpkg –help for help installing and uninstalling packages [*];
    Use `dselect 'or` aptitude' for more friendly package management;
    Type dpkg -Dhelp for a list of dpkg debug settings;
    Type dpkg –force-help for a list of options to force things;
    Type dpkg-deb –help for help on manipulating .deb files;

  2.   truko22 said

    In my NAS with debian I have had bad experience with cleaning tools, I just install localepurge and use aptitude to clean unused dependencies and in chakra I use pacman for dependency and for the rest with the program that the distro brings called Sweeper.

  3.   jackassbq said

    Excellent article. Thanks a lot.

  4.   Ruben said

    And BleachBit? I can manage with that. Although the truth is that I have not cleaned for about three months and it still works well, I do not notice it slower.

    1.    VaryHeavy said

      That's the one I was going to name. With BleachBit, supported by Filelight to monitor the size of the various discs, I manage quite well.

      1.    VaryHeavy said

        Different directories wanted to say ... that I ate a word ...

    2.    Germaine said

      For my taste BleachBit is the "most dangerous" of all, you have to know what to say yes and no, because I have seen that after using it and detailing it, the systems are unusable ... result ... format and install zeroes.

  5.   Pin said

    It would have been good to clarify that all this process is for Debian or derived distributions ...

    1.    sieg84 said

      as soon as I read I must… I stopped reading.

      1.    Blaire pascal said

        Haha me too. Lie, I read it but with a stake in my mind telling me to stop reading.

        1.    Germaine said

          Be careful with the stake and more if you are an arch-vamp… hehehe 🙂 Knowing to compare is winning and having better arguments. That's what the wise say (and I believe them).

          1.    Manual of the Source said

            What's wrong with being Arch-Vamp? * Pulls out fangs *

      2.    Germaine said

        You missed having fresh information to confront with your Suse and then argue ... because even if you or I do not use it, it must be known, (it is my personal opinion respecting yours).

        1.    sieg84 said

          so I have missed a lot of information, whenever I see for / from / in debian, I pass by. 😛

  6.   koratsuki said

    Noted in my scores. Gr8!

    1.    Blaire pascal said

      Gr8? I had never read that. Memorized hehe.

  7.   m said

    "One of the benefits with which we are invited to use GNU / Linux is that it is not filled with garbage, as this is not true,"

    This generalization is ABSOLUTELY WRONG and can certainly lead new users of GNU / Linux to misconceptions about the operating system.

    You should clarify that the problems you mention are related EXCLUSIVELY TO DEBIAN AND ITS PACKAGING SYSTEM since in the distro that I use only once I found three orphaned packages and this happened because I had been getting my hands on the system.

    Likewise, the term "GARBAGE" seems to me WRONG to refer to files that ARE PART OF THE OPERATING SYSTEM such as logs, manuals and language files, etc.

    Trash can be found in the Windows registry since it is common for poorly programmed applications to leave traces of their passage through the system when uninstalled; also intrinsic system problems, sudden blackouts and why not malware usually corrupt the registry.

    Although GNU / Linux is not without its problems, it is highly unlikely to run into broken installations or applications for no apparent reason.

    I think this decidedly mediocre article SEVERELY affects the perception that a nobel or non-GNU / Linux user may have of the system.
    At the very least, it would be necessary to specify in this particular case we speak of Debian GNU / Linux.

    1.    Germaine said

      Newbies understand the term GARBAGE better ... as generally they come from W $ where there is a lot and it sucks. You have to talk to new people with the terms they know, then you "cultivate" them to make them better ... because they are already on Linux ... and Trash in the best sense is the result of an interaction where the best is extracted of something and there is a residue called excretion ... these must be eliminated ... because they are a burden, whatever you call the system that generates them.

      1.    msx said

        For hollow talk politician you are doing well.

        You did not understand anything.

        1.    Manual of the Source said

          I hope I don't fall under the label of "empty talk politician" myself, but Arch does accumulate rubbish; depending, of course, on what you mean by the term "garbage." For me that can be used to refer to something that you don't need, that is just getting in the way, and if you don't need the logs, the manuals, or the language files (except the one in use, obviously), then it's rubbish.

          Over here They were talking about a script to automate some cleaning tasks in Arch. At least the basic thing would be to run the # pacman -Sc after each update or uninstallation of programs, since the cache of non-installed applications can take up a lot of space; and the # pacman -Qdt to check the orphaned packages, which in my case I just did (after months of last time) and found 12.

        2.    Germaine said

          And then neither are you MSX ... we are already two! Would you like a coffee? And let's not fill this with "garbage" that what people are looking for among other things on this page are solutions, not demonstrations of knowledge, or shine to the ego.

          1.    KZKG ^ Gaara said

            what people are looking for among other things on this page are solutions, not demonstrations of knowledge, or ego shine.

            Amen to this, great 🙂

          2.    m said

            I'm not going to apologize for seeking excellence and fighting mediocrity.

          3.    Blaire pascal said

            Epic commented.

  8.   Pink Desktop Fresh said

    How do I install it on my brand new Rosa Linux 2012 Desktop Fresh?

    1.    sieg84 said

      the equivalent for ROSA would be urpme -auto-orphans, but ... http://blogdrake.net/blog/abagune/como-elimine-paquetes-huerfanos

    2.    Germaine said

      Hey friend, can you do me a favor, can you give me the ROSA icons, I had them but I accidentally deleted them and I couldn't get them back. Thanks in advance.

      1.    sieg84 said

        download it directly from the rose repos and just unzip the RPM http://mirror.yandex.ru/rosa/rosa2012.1/repository/SRPMS/main/updates/rosa-icons-1.0.37-1.src.rpm

  9.   Alf said

    –M | 5 hours ago |
    I will not apologize for seeking excellence and fighting mediocrity.

    mediocre adj
    1 Which is of medium or fair quality, or rather poor: their latest album is somewhat mediocre.
    2 That it is not interesting or that it has no value: the work done was mediocre, so it did not win the award.
    - adj./s. com.
    3 It applies to the person who is not intelligent or who does not have enough capacity for the activity he performs:

    Measure your words, I only ask that, that you do not like it does not mean that it does not meet the content standards of the network.

    If I don't have intelligence for you, you would need to know me, I have developed production and administrative processes, I have collaborated in the creation of companies, so do not say that I have no intelligence, do not hide behind the anonymity of the network, because here in my land what is said with the mouth, is sustained with the balls. It's the only thing I have to tell you.

    1.    msx said

      Look at Kung Fu, that the post is incomplete happens, but spreading FUD cheerfully does not.

    2.    elav said

      Quiet AlfWe know that there is a lot of troll on the loose, don't be provoked because as we know, the network lends itself to what they cannot face.

      mPlease, it would be good if you measured your words because even when you are right (which does not mean that you are), that does not give you the right to offend and call the contribution of any user on the site mediocre. DesdeLinux. If you think you can do something better, you are invited to collaborate, but believe me, here the article that may seem most insignificant or mediocre to you, we value it as the best because it always teaches us something.

      Peace and love colleagues ..

      1.    msx said

        I'm not trolling. Obviously the guy is a temperamental and violent man who does not bank a criticism said as a man and not as a diplomatic lady

        When you do something public, * YOU MAKE IT PUBLIC *.

        1.    elav said

          msx, "that guy" as you say can be whatever you want, he can even be a dictator or the biggest son of a bitch on earth, the point is that it is very ugly (and very easy) to offend when we hide behind a nickname and we have a computer as a form of exchange. And "that guy" like you or any other user on DesdeLinux, you have to respect it.

          Precisely the fact that it is something "public" is a way of reaching many more people, and if Alf or any user makes a mistake in what he writes and publishes, of course he can be rectified but in the correct way. I do not see anything mediocre in your article, believe me that I have seen much more mediocre things that have come out of the minds of "more important" people socially speaking.

          Please, let's leave this topic now. I only ask that there be respect towards any user, since we have always characterized ourselves as being like this since the beginning of DesdeLinux.

    3.    Carlos-Xfce said

      Hi, Alf. I liked your article because I learned about something new in Linux that I did not know.

      I don't know who you are replying to in this comment, but I was "encouraged" (encouraged) to write this to you because I see that you use the dictionary. For my part, I just want to point out an error in the first paragraph, where you misuse the verb "encourage".

      "Encourage" does not mean "slow down." This is a very common mistake. For that we have "slow down". Thus, in Linux we have the advantage that the system is stable and does not slow down as it happens with Windows.

      1.    msx said

        : trolling: He must slow down his soccer team! xD: / trolling:

  10.   Alf said

    Carlos-Xfce, I take note of your correction, if I remember correctly, you had already done it to me in another post, but I have vices in several words, vices a little difficult to correct.

    elav, believe me not to bother me, it is very difficult for me to get angry, it is just my way of speaking, very beaten up, that's why I write little, I tend to be misunderstood.

    1.    Carlos-Xfce said

      Hi, Alf. Don't worry about mistakes - we all make them, it's normal. Human language is not perfect, neither are humans, so there are always going to be mistakes. The important thing is to learn so as not to fall into the fault again.

      The verb "slow down" is unknown to many people. This action is not part of people's daily life, as is the case with its antonym "accelerate" and the way to cut off such action: "brake", "stop", "stop". Along with "slow down," there are also "slow down" and "slow down." This last form is also a derived word as in our case the erroneous "encourage".

      And yes, I think I had already corrected something out there. Thanks for your articles; they are a means to learn interesting things that you did not know before. I hope to read you again soon. Regards.

      1.    msx said

        People in general speak badly, possibly because almost no one reads and if they do it is limited to a specific topic where they always find the same vocabulary and often deduce the meaning of words they do not know according to the context instead of going to look at the mataburros because it gives them a lot of work.
        Some of the atrocities that I hear every day are "If I had time, I would!" ... NOT ANIMAL, IT WOULD HAVE TO CORRESPOND TO ANOTHER VERBAL TENSE, if you had or had time, fuck.
        Or for example when they interchangeably use "see" and "look", "hear" and "listen".
        I'm not saying this because of @Alf, anyone has a slip, in general it is very annoying to have to use a simplified language so that they understand you or hear nonsense like "what happens is that you speak in difficult" to which I invariably answer " I do not speak difficult or difficult, I speak in colloquial Rio de la Plata Spanish, your problem is that you lack vocabulary, did you ever try opening a book to see what you find or consulting the dictionary to even see what it is about? »
        Some laugh admitting that they said a nonsense (the few, obviously I like them) and most of them get excited, angry and offended, it is very funny to see them.

      2.    sjah said

        After reading the comments of "msx", quite entertaining - let it be said -, you can add:

        1. You make spelling mistakes, syntactic errors and, as far as semantic structure is concerned, you are not entirely on track.
        2. I have found this entry because I was looking for different ways to eliminate junk files. Yes: "garbage." They don't work for me, I don't use them, they take up disk space and deleting them doesn't cause any problem in my OS; Rather the complete opposite.

        Then, after so much lesson on "excellence" proclaimed without example, when both Windows and many versions based on Debian have a BIN, commands such as CLEAN or icons type BROOM, etc., it would be better to stick to a certain script, one that I only suggest → thank the contribution or contributions and stop "excellence".

        Your excellence.

  11.   matias said

    Test

  12.   TESTS puedo modificarlo said

    Very good.

  13.   Anto said

    I have debian stable jessie) with lxde and I have used debfoster answering yes to almost everything
    and it has uninstalled half the system, many packages: games, applications, utilities. My debian was "peeled." I thought that I would keep all that and deleted them. Before I had used deborphan and deborphan-gtk several times until no packages came out and everything was fine.
    did I do something wrong?