I've seen that I've lots of packages that I seem to no longer need. Would it
be safe to run
Pacman -R $(pacman -Qtdq)
Regards,
Guillermo Leira
12-04-2011, 02:02 PM
Karol Blazewicz
Deleting packages
On Sun, Dec 4, 2011 at 3:56 PM, Guillermo Leira <gleira@gleira.com> wrote:
> Hello!
>
> I've seen that I've lots of packages that I seem to no longer need. Would it
> be safe to run
>
> Pacman -R $(pacman -Qtdq)
>
> Regards,
>
> Guillermo Leira
Short answer: yes, pacman will ask you if you really want to remove
these packages so check the output before saying 'yes'.
BTW, you sill get 'Pacman: command not found' if you run it with capital 'P'.
Please search the forums and understand what 'pacman -Qtdq' does.
You might want to read the pacman manpage on how to change the install reason.
12-04-2011, 08:02 PM
"Guillermo Leira"
Deleting packages
-----Original Message-----
From: Karol Blazewicz <karol.blazewicz@gmail.com>
To: General Discussion about Arch Linux <arch-general@archlinux.org>
Date: Sun, 4 Dec 2011 16:02:55 +0100
Subject: Re: [arch-general] Deleting packages
> On Sun, Dec 4, 2011 at 3:56 PM, Guillermo Leira <gleira@gleira.com>
> wrote:
> > Hello!
> >
> > I've seen that I've lots of packages that I seem to no longer need.
> Would it
> > be safe to run
> >
> > Pacman -R $(pacman -Qtdq)
> >
> > Regards,
> >
> > Guillermo Leira
>
> Short answer: yes, pacman will ask you if you really want to remove
> these packages so check the output before saying 'yes'.
> BTW, you sill get 'Pacman: command not found' if you run it with
> capital 'P'.
>
> Please search the forums and understand what 'pacman -Qtdq' does.
> You might want to read the pacman manpage on how to change the install
> reason.
I think that I understand more or less what it does... but I don't
understand why there are about eighty unneeded and "installed as
dependencies" packages. And I have already removed about thirty.
I have run pacman -Qtdq and studied the output. Some packages seems to be
part of gnome 2, but most of them I don't know where they came from.
I'm not a programmer, so I can't submit code, but it would be nice if
pacman would say "Installed as a dependency of: package-name", or
something similar. It's just a suggestion.
Hummm... I'm seeing some pacman -R options that can be very useful to keep
the system clean. Maybe I should have used it, and now I wouldn't have
these "orphan" packages in my disk.
And the capital "P" is not completely my fault. Outlook takes decisions on
its own. :-)
Thanks,
Guillermo Leira
12-04-2011, 08:12 PM
Karol Blazewicz
Deleting packages
On Sun, Dec 4, 2011 at 10:02 PM, Guillermo Leira <gleira@gleira.com> wrote:
> Hummm... I'm seeing some pacman -R options that can be very useful to keep
> the system clean. Maybe I should have used it, and now I wouldn't have
> these "orphan" packages in my disk.
Yup, I think this is reason.
After running 'pacman -R $(pacman -Qtdq)' you can have some more of
these orphans.
12-04-2011, 08:19 PM
Karol Blazewicz
Deleting packages
> On Sun, Dec 4, 2011 at 10:02 PM, Guillermo Leira <gleira@gleira.com> wrote:
> I'm not a programmer, so I can't submit code, but it would be nice if
> pacman would say "Installed as a dependency of: package-name", or
> something similar. It's just a suggestion.
Indeed: https://bugs.archlinux.org/task/7224 and in some way
https://bugs.archlinux.org/task/5974 and
https://bugs.archlinux.org/task/24005
12-07-2011, 06:47 PM
clemens fischer
Deleting packages
Guillermo Leira wrote:
> I'm not a programmer, so I can't submit code, but it would be nice if
> pacman would say "Installed as a dependency of: package-name", or
> something similar. It's just a suggestion.
If a package is removed without its dependencies, those dependencies
also lose the pointer to the package that once pulled them in. Note
that this relation is not hardcoded, which makes sense: packages may
depend on others with a lower bound on the version needed, but any
version thereafter will do. Nonetheless storing the "original" package
name+version could be done, maybe in an additional field to avoid the
need of updating the "dep: name+version" field each time a new
version is installed.
> Hummm... I'm seeing some pacman -R options that can be very useful to
> keep the system clean. Maybe I should have used it, and now I wouldn't
> have these "orphan" packages in my disk.
pacman -Rs $(pacman -Qtdq)
The "s" means (from the man page):
Remove each target specified including all of their dependencies,
provided that (A) they are not required by other packages; and (B)
they were not explicitly installed by the user. This operation is
recursive and analogous to a backwards --sync operation, and helps
keep a clean system without orphans. If you want to omit condition
(B), pass this option twice.
You can make this even more aggressive by using "pacman -Rcs".
I used
for i in $(pacman -Qtdq); do pacman -Rs $i;done
because there are packages I want to keep. Without the for loop, pacman
will remove the whole bunch, with it I get the confirmer question one by
one.