How to remove orphaned packages in Arch

Pacman it is, without a doubt, one of the best package managers. However, some of its associated managers (such as Yogurt o Packer) although they are very good, they leave a little to be desired. In particular, by staying truncate la installation de packages through AUR it is common for installed dependencies not to be removed properly after a compilation failure. This is especially true, the higher the number of dependencies to install.


The solution is very simple: we must delete the packages that were orphaned (that is, no other package needs them and we can delete them without causing problems).

I just opened a terminal and wrote:

sudo pacman -Rs $ (pacman -Qtdq)

What it does is delete all the packages and their dependencies (pacman -Rs) from a specific package list (which, in our case, are the orphaned packages, whose list is obtained with pacman -Qtdq).

For those who come from Ubuntu, this command is similar to sudo apt-get autoremove.


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.   Let's use Linux said

    Good!

  2.   Diego Silverberg said

    Phenomenal! It suited me like a glove, I released about 1 GB of garbage from when I first met arch!

  3.   Shadow reaper said

    Perfect, I released 425,85 MiB of packages that did not work for me, thanks!

    1.    let's use linux said

      On the contrary, that's what we are for!
      Cheers! Paul.

  4.   Quiqueservos said

    Thanks for the article. I had replaced Openbox with Cinnamon and wanted to leave the system clean. I ended up freeing up a tremendous amount of space.

    1.    let's use linux said

      You're welcome! Hug! Paul.

  5.   Chaparral said

    Good but what happens when in Antergos and in the console we throw $ yaourt -Syua and the answer is:

    :: Synchronizing the package databases ...
    core is up to date
    extra is up to date
    community is up to date
    antergos is up to date
    ksplash-arch-simple: Orphan
    plasma-theme-caledonia: Orphan
    External packages: / 53/53

    I've googled information but found no answer.

    1.    Tiles said

      It's the same, yaourt uses pacman sometimes, it's what I understand hahaha
      For the same, you can use a simple sudo pacman -Rs $ (pacman -Qtdq) and that way you forget about all the orphans. In yaourt there should be a similar form but I haven't been fiddling with the manager so much.
      In any case, when something is installed in Arch via yaourt it is also recognized by pacman.

  6.   Chaparral said

    I did it with this other command that is slightly different:
    $ sudo pacman -Rns $ (pacman -Qtdq)

    Although the one you indicate works perfectly, I have verified it.
    I have read that there are those who are not in favor of eliminating any orphan package.

    1.    alter said

      I use it but I really don't have the explanation of the chaparral command (do you know?) I would like to know