You are not logged in.

#1 2008-11-19 01:39:48

suilenroc
Member
Registered: 2008-08-18
Posts: 23

Clean up, clean up, everybody everywhere!

Hey all, Suilenroc here. I'm a relatively new user of arch linux, and was wondering how if someone could help me with cleaning up my system. I remember that, In Ubuntu, there were a few scripts that would uninstall unneeded packages and prereqs, and other things of that nature. Also, I somehow managed to isntall a few KDE apps on my gnome system, I know not how. Konquerer and Knetworking are there. does anyone know how to delete those?

Thanks!

Offline

#2 2008-11-19 01:48:22

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: Clean up, clean up, everybody everywhere!

pacman -R <pkgname> to remove a package
pacman -Qdt to remove unneeded dependencies


.:[My Blog] || [My GitHub]:.

Offline

#3 2008-11-19 01:51:12

suilenroc
Member
Registered: 2008-08-18
Posts: 23

Re: Clean up, clean up, everybody everywhere!

Oh hey, thanks. I can't seem to figure out what package Konquerer is in, as sudo pacman -R konquerer doesn't work. Do you know?

Offline

#4 2008-11-19 01:52:15

suilenroc
Member
Registered: 2008-08-18
Posts: 23

Re: Clean up, clean up, everybody everywhere!

Hmm...I ran pacman -Qdt, and it lists some packages, yes, but they aren't unneeded. Is that just a danger of using that tool?

Offline

#5 2008-11-19 01:53:11

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Clean up, clean up, everybody everywhere!

Remove unneeded dependencies: pacman -Rs $(pacman -Qtdq)
Remove package and its unneeded dependencies: pacman -Rs

I recommend aliasing the former to something (I have it set to 'pacmanro'). Alias sudo to 'sudo ' first to be able to 'sudo pacmanro'.

'pacman -Qdt' will list all packages that were installed because they were needed by packages you specifically asked to be installed, but are no longer needed by any packages. If you definitely use one of the packages it lists (be sure! It's usually correct), either edit the pacman db to say it is explicitly installed and not a dependency (should be simple, but I don't know how OTOH), or re-install with 'pacman -S'.

On a related note, 'pacman -S --asdeps' will install a package and list it as a dependency. Remember, if you don't install a package that requires the one you just named a dependency, one of the commands that lists or removes unneeded dependencies will list/remove it.

Need anything else? smile

Last edited by Ranguvar (2008-11-19 02:00:18)

Offline

#6 2008-11-19 02:06:29

suilenroc
Member
Registered: 2008-08-18
Posts: 23

Re: Clean up, clean up, everybody everywhere!

Hey, thanks. I'm having trouble with the aliasing, though. I set an alias in ~/.bashrc of:

sudo = 'sudo'
and the pacmanro one. However, I just can't do "sudo pacmanro". It says that pacmanro is a command that's not found. What's up?

Offline

#7 2008-11-19 02:43:20

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Clean up, clean up, everybody everywhere!

Note the space at the end of my alias - 'alias sudo='sudo ' wink

In bash, a space at the end of an alias tells bash to look at the command following to see if it has an alias as well.

Offline

#8 2008-11-19 02:55:36

suilenroc
Member
Registered: 2008-08-18
Posts: 23

Re: Clean up, clean up, everybody everywhere!

Hey, there we go! Thanks for that man, that worked wonders. I also found a nice tutorial on how to search the pacman database on my computer to find what packages certain programs belong to. I've never seen these "aliases" before. I have a feeling that they'll become very useful...

Offline

#9 2008-11-19 03:08:30

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Clean up, clean up, everybody everywhere!

Welcome smile

'man bash' has a lot of info on aliases.

Offline

#10 2008-11-19 03:13:23

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Clean up, clean up, everybody everywhere!

Ranguvar wrote:

Remove unneeded dependencies: pacman -Rs $(pacman -Qtdq)

On my system that will remove cups. I'm rather fond of printing. This is, was, and always will be a not-so-good thing to do.

Offline

#11 2008-11-19 03:23:48

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Clean up, clean up, everybody everywhere!

That just means you have cups installed as a dependency to a package that was removed. Just re-install cups same as any other package and it will be listed as explicity installed, and that command will not want to get rid of it.

Offline

#12 2008-11-19 03:27:08

dsr
Member
Registered: 2008-05-31
Posts: 187

Re: Clean up, clean up, everybody everywhere!

I agree with skottish. It's probably not a good idea to run `pacman -Rs $(pacman -Qdtq)' unless you're sure you don't need any of the packages that will be uninstalled. A better idea might be just to run `pacman -Qdt' to list packages that you might want to uninstall. Then read the output, and then remove them with pacman. An even better idea might be to remove packages you don't want with `pacman -Rscn' rather than `pacman -Rs', so that you never have those unrequired dependencies lying around. Note that this carries the same risk as `pacman -Rs $(pacman -Qdtq)', so you should make sure to read pacman's output before giving it the 'y' goahead.

Offline

#13 2008-11-19 03:33:30

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Clean up, clean up, everybody everywhere!

Ranguvar wrote:

That just means you have cups installed as a dependency to a package that was removed. Just re-install cups same as any other package and it will be listed as explicity installed, and that command will not want to get rid of it.

I'm not doing this to prove you wrong; I was honestly curious:

~ > sudo pacman -S cups
warning: cups-1.3.9-1 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...

Targets (1): cups-1.3.9-1  

Total Download Size:    3.29 MB
Total Installed Size:   15.97 MB

Proceed with installation? [Y/n] y
:: Retrieving packages from extra...
 cups-1.3.9-1-x86_64        3.3M  201.0K/s 00:00:17 [#####################] 100%
checking package integrity...
(1/1) checking for file conflicts                   [#####################] 100%
(1/1) upgrading cups                                [#####################] 100%
~ > pacman -Qtdq
cups

Last edited by skottish (2008-11-19 03:33:56)

Offline

#14 2008-11-19 03:57:56

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Clean up, clean up, everybody everywhere!

Huh! That's really odd. I've personally never had any problem with it. Worrying that pacman still thinks cups is a dependency.

Offline

#15 2008-11-19 04:37:32

chno95
Member
Registered: 2008-11-12
Posts: 5

Re: Clean up, clean up, everybody everywhere!

skottish wrote:
Ranguvar wrote:

Remove unneeded dependencies: pacman -Rs $(pacman -Qtdq)

On my system that will remove cups. I'm rather fond of printing. This is, was, and always will be a not-so-good thing to do.

On my other computer, it removes tar. So does pacman -Rcssn <any package that uses requires tar>. Hm...

Offline

#16 2008-11-19 04:40:19

dsr
Member
Registered: 2008-05-31
Posts: 187

Re: Clean up, clean up, everybody everywhere!

That's because you used two `s' options, which will uninstall unrequired packages even if you installed them manually. Try just `pacman -Rscn <package>'.

Offline

#17 2008-11-19 05:59:08

xd-0
Member
From: Sweden
Registered: 2007-11-02
Posts: 327
Website

Re: Clean up, clean up, everybody everywhere!

"pacman -hQ" shows the query help information (including all info about the arguments), same goes for remove and "pacman -hR".

edit: That said, read everything and try to learn the arguments by heart, the wiki have also a section on pacman. It's a powerful tool and you can do almost everything, just read all info and don't be afraid to ask questions.

Last edited by xd-0 (2008-11-19 06:02:14)

Offline

#18 2008-11-19 09:55:42

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: Clean up, clean up, everybody everywhere!

skottish wrote:
Ranguvar wrote:

Just re-install cups same as any other package and it will be listed as explicity installed, and that command will not want to get rid of it.

I'm not doing this to prove you wrong; I was honestly curious:

...
~ > pacman -Qtdq
cups

I've noticed this before too. Merely calling "pacman -S package" doesn't seem to update the database record of whether the package was installed as a dependency or not. I think for reinstalls one needs to explicitly say --asdeps or --asexplicit to change that flag. (That certainly SHOULD be enough; whether it IN FACT IS enough I'm not sure. I remember sometimes I've had to resort to uninstalling/reinstalling to get the database to accept what I'm trying to tell it about whether the package is a dependency. That suggests that reinstalling with the --asdeps/--asexplicit flags wasn't enough. But I don't remember the details.)

Offline

#19 2008-11-19 23:30:32

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Clean up, clean up, everybody everywhere!

pacman -S --asexplicit cups

Or install metapax and do "metapax --mark-explicit cups" if you don't want to do pacman's installation dance.

edit
I've just learned from Allan that "pacman -S <whatever>" doesn't change the install reason for previously installed packages. I did a quick test using the "--asdeps" and "--asexplicit" options and they work as expected.

Last edited by Xyne (2008-11-20 01:11:26)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB