You are not logged in.

#1 2016-11-12 20:57:56

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

pacman finding orphaned packages

In one of the posts replying to another thread in this area I thought I would try to use pacman -Qtd to find orphaned packages, and clean up my machine, and interestingly some of the packages it lists are not orphaned - so I wondered if this is expected behaviour or not?


Mike C

Offline

#2 2016-11-12 21:01:50

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,865
Website

Re: pacman finding orphaned packages

Orphaned in this case means 'installed as a dependency for another package, but no longer required'. 'Orphan' probably isn't the right term to use, but I'm lazy.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2016-11-12 21:04:38

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: pacman finding orphaned packages

OK - it is important to go through them and check if they are still in the repos, and also if they were perhaps still needed for the system being investigated. So hopefully someone won't simply pacman -R on each package in the list produced without further exploration.


Mike C

Offline

#4 2016-11-12 21:11:17

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,865
Website

Re: pacman finding orphaned packages

Oh, they can still be in the repositories, they just aren't 'needed' by your system any more, at least as far as pacman is aware. If some packages are listed that you _do_ need, let pacman know using it's -D flag.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2016-11-12 21:38:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,532
Website

Re: pacman finding orphaned packages

mcloaked wrote:

OK - it is important to go through them and check if they are still in the repos, and also if they were perhaps still needed for the system being investigated. So hopefully someone won't simply pacman -R on each package in the list produced without further exploration.

I frequently run `pacman -Rsn $(pacman -Qdtq)`.  But I also have ensured I've properly installed the packages that I actually want on my system.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2016-11-12 21:39:57

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: pacman finding orphaned packages

+1 for what Trilby said... you can add an alias to your shellrc as well:

alias orphans='[[ -n $(pacman -Qdt) ]] && sudo pacman -Rs $(pacman -Qdtq) || echo "no orphans to remove"'

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2016-11-12 22:06:12

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: pacman finding orphaned packages

In  my case if I run pacman -Qtdq one of the packages listed is plasma-mediacenter for example - but that is a standalone package in extra that I did install because I wanted to use it. Wouldn't your commands remove that package? Unless, that is, I had already gone through all of the packages that fall into this category and use the pacman -D parameter with --asexplicit<package> ?  For that to work it would be  necessary to have methodically changed the database attributes for every packages that you want to keep - but I was not that well organised - though it would be worth the effort in the long run!


Mike C

Offline

#8 2016-11-12 22:34:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,532
Website

Re: pacman finding orphaned packages

mcloaked wrote:

... but that is a standalone package in extra that I did install because I wanted to use it.

You may have wanted to use it, but you did not install it directly, it was only installed as a dependency of another package.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2016-11-13 09:59:06

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: pacman finding orphaned packages

Trilby: yes - true!


Mike C

Offline

Board footer

Powered by FluxBB