You are not logged in.
Hi
Over the past few days I decided to try out a lot of new programs, some of them from the testing repos, and ended up removing almost all of them. However, I am worried that there are may be many left over/unnecessary packages, or that I may have accidentally removed some necessary packages. So far nothing has gone wrong except for a while no Qt-based apps would work, but I managed to fix that by aimlessly removing/adding things until it worked (the problem was due to something I installed from the testing repo).
Basically, my question is does pacman support a feature that can go through the packages installed and add any necessary packages that have been removed? Also, does it support a feature that can "clean out" the packages to see if there are any that are not required? It probably doesn't, because that would go against the K.I.S.S philosophy (but there is no harm in asking).
Also, I read through the pacman manual entry (man pacman) and couldn't find a switch that seemed to do what I am asking.
Thanks, and in the future I will be more careful with what I install!
Offline
One thing that might help you with your cleanup.
# pacman -Qdt
will list all "orphans" (no longer required as dependencies) which should be safe to remove.
Burninate!
Offline
Also, pacman takes care of dependencies, so you would not be able to remove B and keep A if A depends on B (using pacman -R for example)
Offline
One thing that might help you with your cleanup.
# pacman -Qdt
will list all "orphans" (no longer required as dependencies) which should be safe to remove.
I've read that one cannot fully trust the outcome of this command
and that they should always make sure that the packages listed are indeed not needed instead.
Is this valid? Does anyone know?
Offline
Gcool wrote:One thing that might help you with your cleanup.
# pacman -Qdt
will list all "orphans" (no longer required as dependencies) which should be safe to remove.
I've read that one cannot fully trust the outcome of this command
and that they should always make sure that the packages listed are indeed not needed instead.
Is this valid? Does anyone know?
I think the main problem is, even though a package might not have any TECHNICAL dependencies, that doesn't mean you don't USE it.
You know, like finding out no other package is using SLiM, and so you remove it only to find out you can't easily login to X anymore.
Offline
I think the main problem is, even though a package might not have any TECHNICAL dependencies, that doesn't mean you don't USE it.
You know, like finding out no other package is using SLiM, and so you remove it only to find out you can't easily login to X anymore.
slim would not be a dependency but something you explicitly installed and therefore not be part of the output of pacman -Qdt. pacman -Qdt shows packages that were installed as dependencies (-d) and are not anymore required by any other package (-t). IMHO this should be safe, I've done
pacman -R $(pacman -Qqdt)
dozens of times and never run into problems.
Offline
slim would not be a dependency but something you explicitly installed and therefore not be part of the output of pacman -Qdt. pacman -Qdt shows packages that were installed as dependencies (-d) and are not anymore required by any other package (-t). IMHO this should be safe, I've done
pacman -R $(pacman -Qqdt)
dozens of times and never run into problems.
Thanks for clearing that up! That sounds like a good tip. I'll try it out when I get home.
Last edited by drcouzelis (2012-04-16 14:03:23)
Offline
You can also use the '-D' switch to clean up the 'pacman -Qqdt' output.
http://allanmcrae.com/2011/07/secondary … th-pacman/
Offline
---- EDIT ----
You can also use the '-D' switch to clean up the 'pacman -Qqdt' output.
http://allanmcrae.com/2011/07/secondary … th-pacman/
what he said
Last edited by scjudd (2012-04-16 14:16:18)
Offline
drcouzelis wrote:I think the main problem is, even though a package might not have any TECHNICAL dependencies, that doesn't mean you don't USE it.
You know, like finding out no other package is using SLiM, and so you remove it only to find out you can't easily login to X anymore.
slim would not be a dependency but something you explicitly installed and therefore not be part of the output of pacman -Qdt. pacman -Qdt shows packages that were installed as dependencies (-d) and are not anymore required by any other package (-t). IMHO this should be safe, I've done
pacman -R $(pacman -Qqdt)
dozens of times and never run into problems.
I'm using the same syntax, but now after thinking about it, is there any reason against using 'pacman -Rs $(pacman -Qqdt)'? You see, -Q(q)dt will list any packages which were only installed as dependencies and are no longer required, but that doesn't mean that there aren't any packages depending on themselves. Removing one wave of orphans might just create another. Obviously using -Rs while namely uninstalling packages is safe, but is it safe to use in this context?
Running arch is like raising a puppy - if you spend a bit of time with it each day and do just a bit of training you'll end up with the most loyal partner you could want; if you lock it in a room and don't check on if for several days, it'll tear apart your stuff and poop everywhere.
Offline
I'm using the same syntax, but now after thinking about it, is there any reason against using 'pacman -Rs $(pacman -Qqdt)'? You see, -Q(q)dt will list any packages which were only installed as dependencies and are no longer required, but that doesn't mean that there aren't any packages depending on themselves. Removing one wave of orphans might just create another. Obviously using -Rs while namely uninstalling packages is safe, but is it safe to use in this context?
good point, I actually always repeatedly called pacman -R $(pacman -Qqdt) until no more packages were left, didn't think about the -s switch.
Offline
... pacman -R $(pacman -Qqdt) ...
The Pacman Rosetta recommends
pacman -Qdtq | pacman -Rs -
instead of that command. I think it used to recommend that but was changed at some point. I also think I read an explanation for the change here on the forums (by falconindy maybe?), but I may just be going mad.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
@alphaniner
https://bugs.archlinux.org/task/9180
http://mailman.archlinux.org/pipermail/ … 11925.html <- falconindy's explanation
http://mailman.archlinux.org/pipermail/ … 12666.html
Last edited by karol (2012-04-16 21:02:57)
Offline
You can also sift through /var/log/pacman.log to get an idea of what you installed and uninstall it manually.
Offline
Usually after running pacman -Qdt, I run pacman pacman -Qeqt to show me the packages I've installed explicitly...
Last edited by brenix (2012-04-17 00:26:05)
Offline
pacman -R $(pacman -Qqdt)
pacman -Qdtq | pacman -Rs -
Ok, so, now that I'm home and try out these commands, I run into the problem I usually see: they suggest removing things I don't want removed. You know, such as libtar and xorg-server.
What's different between our systems that allows you to run that command all the time and never have a problem and my system.
Offline
pacman -R $(pacman -Qqdt)
pacman -Qdtq | pacman -Rs -
Ok, so, now that I'm home and try out these commands, I run into the problem I usually see: they suggest removing things I don't want removed. You know, such as libtar and xorg-server.
What's different between our systems that allows you to run that command all the time and never have a problem and my system.
I ran into the same problem. At first it seemed to be working but then it started wanting to remove things I knew I needed as I kept running the command. Doesn't seem safe to me, I feel like I'm going to break something.
Offline
rm -rf --no-preserve-root /
Wipes entire system
But uhm
pacman -Qdt
uninstall
rm /var/cache/pacman/pkg/*.pkg.tar.xz
clear all package cache, without the possibility to downgrade.
Last edited by Androidz (2012-04-17 03:42:38)
Offline
pacman -R $(pacman -Qqdt)
pacman -Qdtq | pacman -Rs -
Ok, so, now that I'm home and try out these commands, I run into the problem I usually see: they suggest removing things I don't want removed. You know, such as libtar and xorg-server.
What's different between our systems that allows you to run that command all the time and never have a problem and my system.
When I got as far as your first post, I knew you were on to something, but couldn't think why. What you have here is a good example.
It all depends on your attitude towards package management.
Say you set up your machine and want to use enter login manager. That'll pull xorg as a dependency, so you think fine, I have that.
Then you go about your merry way and install i3, which doesn't pull xorg.
If you later decide you'll just use xinitrc instead of a login manager, and remove enter for cleanliness, then running pacman -R $(pacman -Qqdt) is going to remove something you actually still want.
However, if you do things the careful way of explicitly installing everything you need to use, that command is A-OK.
Either way, I wouldn't do it myself. I don't like that much automation. I don't even like using asterisks in bash :-/
EDIT: didn't really think that last line through. obviously nothing gets done without confirmation...
Last edited by cupantae (2012-04-17 03:51:13)
By the way, I didn't read any of the posts above me.
Offline
[
rm /var/cache/pacman/pkg/*.pkg.tar.xz
clear all package cache, without the possibility to downgrade.
pacman -Scc
Offline
However, if you do things the careful way of explicitly installing everything you need to use, that command is A-OK.
Good explanation, though there's another way around it. When you run one of the above mentioned commands to clean up your system and find something big amongst the packages to be removed (such as xorg-server), then it's easy enough to do:
pacman -S --asexplicit xorg-server
which will reinstall the package and mark it as explicitly installed. It won't show the next time you run the clean-up command.
pacman -Scc
Neither this nor removing all contents of the cache directory is a very good idea, it might come back and bite you you know where. As Androidz already stated there's no possibility to downgrage if you do it, which basically means that you won't be able to go back to current version of any package if anything gets broken on an update.
Running arch is like raising a puppy - if you spend a bit of time with it each day and do just a bit of training you'll end up with the most loyal partner you could want; if you lock it in a room and don't check on if for several days, it'll tear apart your stuff and poop everywhere.
Offline
cupantae wrote:However, if you do things the careful way of explicitly installing everything you need to use, that command is A-OK.
Good explanation, though there's another way around it. When you run one of the above mentioned commands to clean up your system and find something big amongst the packages to be removed (such as xorg-server), then it's easy enough to do:
pacman -S --asexplicit xorg-server
which will reinstall the package and mark it as explicitly installed. It won't show the next time you run the clean-up command..
Offline
Why the need to use pacman -R? Whenever I use pacman -Qdt it offers to remove the packages for me using pacman -Rs (or am I thinking of yaourt here?). No need to call it recursively.
Also, do not use pacman -Scc unless you absolutely need the disk space taken up by the packages in the cache. My update regime is as follows:
pacman -Sc
pacman -Syyu
pacman -Qdt
This way, right before I upgrade, my cache is cleaned up to only the currently installed packages, so I can downgrade if need be.
Cheers.
Offline
Why the need to use pacman -R? Whenever I use pacman -Qdt it offers to remove the packages for me using pacman -Rs (or am I thinking of yaourt here?).
I think it's yaourt or something else.
[karol@black ~]$ pacman -Qdt
git 1.7.10-1
mercurial 2.1.2-1
pacman prints the info and does nothing more.
No need to call it recursively.
Then you may have more unused packages left (the dependencies of the packages you removed) and you need to run 'pacman -Qdt' again etc.
Offline
I think it's yaourt or something else.
Indeed it is yaourt:
(orphans listed here)
==> Do you want to remove these packages (with -Rcs options) ? [y/N]
==> -----------------------------------------------------------------
==>
Running arch is like raising a puppy - if you spend a bit of time with it each day and do just a bit of training you'll end up with the most loyal partner you could want; if you lock it in a room and don't check on if for several days, it'll tear apart your stuff and poop everywhere.
Offline