You are not logged in.
Hi archers,
what do you do to keep your system clean? You surely have / had orphan packages, or packages no more used, so i was wondering what operation you perform to check for installed useless packages and remove them from the system, to keep your arch clean and slim everyday!
Offline
I run this daily after an update (pacman -Syyu), works for me.
#!/bin/bash
tar -cjf /store/bak/pacman-database.tar.bz2 /var/lib/pacman/local
pacman -Rscn $(pacman -Qtdq)
pacman -Sc
pacman-optimize && sync
updatedb
exit 0
Offline
I use these 2 aliases in my zshrc, got them off the forum or wiki a long time ago.
alias lsorhpans='sudo pacman -Qdt'
alias rmorphans='sudo pacman -Rs $(pacman -Qtdq)'
Offline
my update script checks for and removes orphans once the update is done so as I update at least once a day then the system should be always clean.
The idea by droog above is slick
Offline
A couple of questions: With the scripts above how do you prevent it removing needed packages. For example, in my case it would remove gksu which I use. Also, I can run "pacman -Qdt" as a normal user, so why is the sudo required?
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
A couple of questions: With the scripts above how do you prevent it removing needed packages. For example, in my case it would remove gksu which I use.
Install the package explicitly:
pacman --asexplicit -S gksu
Also, I can run "pacman -Qdt" as a normal user, so why is the sudo required?
It isn't.
Offline
loafer got there before me - droog's second command wants to wipe some 800MB off my system, most of which I appear to use all the time (kde-pim being a particularly important candidate). Methinks I don't fully understand pacman. Correct that, meknows I don't fully understand pacman
never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::
Offline
I run this daily after an update (pacman -Syyu), works for me.
#!/bin/bash tar -cjf /store/bak/pacman-database.tar.bz2 /var/lib/pacman/local pacman -Rscn $(pacman -Qtdq) pacman -Sc pacman-optimize && sync updatedb exit 0
I have a couple of question about your script.
1. What is the utility of the sync and updatedb commands? As far as I see they're not related to pacman.
2. Wouldn't run pacman-optimize before an update be more useful?
3. Do you always remove your packages with the -c option? Isn't this dangerous?
Thanks!
rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686
Offline
did anyone mention this yet?
pacman -Qqdt
lists orphans
It's in one of the posts above.
Last edited by loafer (2010-03-23 12:10:58)
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
I have a couple of question about your script.
1. What is the utility of the sync and updatedb commands? As far as I see they're not related to pacman.The sync just makes sure that everything is written to physical media, the updatedb because I call this script after an update script, so I have lots of new ABS files and stuff that I might want to locate.
2. Wouldn't run pacman-optimize before an update be more useful?
Nah, pacman-optimize defrags in effect, update will mess it up again. Update, clean and defrag, sounds about right to me.
3. Do you always remove your packages with the -c option? Isn't this dangerous?
It would be it was anything other than orphans being removed, dependences of orphans can safely go on my system.
Thanks!
Offline
rent0n wrote:I have a couple of question about your script.
1. What is the utility of the sync and updatedb commands? As far as I see they're not related to pacman.The sync just makes sure that everything is written to physical media, the updatedb because I call this script after an update script, so I have lots of new ABS files and stuff that I might want to locate.
2. Wouldn't run pacman-optimize before an update be more useful?
Nah, pacman-optimize defrags in effect, update will mess it up again. Update, clean and defrag, sounds about right to me.
3. Do you always remove your packages with the -c option? Isn't this dangerous?
It would be it was anything other than orphans being removed, dependences of orphans can safely go on my system.
Thanks!
Thank you, very clear!
rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686
Offline
I have about 30 orphan programs, but I use pretty much all of them. One of the orphans was supertuxcart. o_0
Homepage | Arch Linux Women | Arch Linux Classroom
Acer Aspire E5-575G-53VG:
Intel Dual-Core i5-6200U 2.3 GHz; Skylake rev3 | 8GB DDR4 ram | Intel HD Graphics 520 + NVIDIA GeForce 940MX
Qualcomm Atheros QCA9377 802.11ac | Realtek RTL8111/8168/8411 Gigabit Ethernet Controller
Offline
Meskarune made me laugh. Shame on her, I'm supposed to be a tragic figure. O woe is me...
Methinks orphans can adopt themselves, no?
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
I can also recommend "pacman -Rns $(pacman -Qdtq)".
Once you've gotten rid of your orphans (or explicitly installed the ones you actually want) I would recommend this script that displays every package you've explicitly installed, excluding base and base-devel packages. Very useful for finding packages you don't really want anymore.
pacman-explicit
#!/bin/bash
pacman -Qei | awk '/^Name/ { name=$3 } /^Groups/ { if ( $3 != "base" && $3 != "base-devel" ) { print name } }'
Last edited by Odysseus (2010-03-24 00:59:18)
I'm the type to fling myself headlong through the magical wardrobe, and then incinerate the ornate mahogany portal behind me with a Molotov cocktail.
Offline
I can also recommend "pacman -Rns $(pacman -Qdtq)".
Once you've gotten rid of your orphans (or explicitly installed the ones you actually want) I would recommend this script that displays every package you've explicitly installed, excluding base and base-devel packages. Very useful for finding packages you don't really want anymore.
pacman-explicit
#!/bin/bash pacman -Qei | awk '/^Name/ { name=$3 } /^Groups/ { if ( $3 != "base" && $3 != "base-devel" ) { print name } }'
Oooh, I like that. I modified it slightly to save to a text document, but that's a very useful command. Saving to my ~/.scripts folder.
Offline
I can also recommend "pacman -Rns $(pacman -Qdtq)".
Once you've gotten rid of your orphans (or explicitly installed the ones you actually want) I would recommend this script that displays every package you've explicitly installed, excluding base and base-devel packages. Very useful for finding packages you don't really want anymore.
pacman-explicit
#!/bin/bash pacman -Qei | awk '/^Name/ { name=$3 } /^Groups/ { if ( $3 != "base" && $3 != "base-devel" ) { print name } }'
I also really like this. Very simple, very easy - the sort of thing that makes one say "why didn't I think of that?" I put it in a shell function rather than a separate script since it's so small.
Offline
Oh I like it too!!
Small modification so that I can also see the description.
pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}'
Modified because someone asked for it.
Last edited by marxav (2010-09-18 23:30:04)
Offline
Oooh...thanks for the script. Funny enough, I'd designated today as system clean up day, lol.
Offline
Hadn't thought much about it but:
pacman -S $(pacman -Qqe | grep -vx "$(pacman -Qqm)")
will reinstall your explicits. Sorry, it's late and need to go to bed .
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
I run this daily after an update (pacman -Syyu), works for me.
#!/bin/bash tar -cjf /store/bak/pacman-database.tar.bz2 /var/lib/pacman/local pacman -Rscn $(pacman -Qtdq) pacman -Sc pacman-optimize && sync updatedb exit 0
What's with this /store path?
I run this and I get this back;
[root@arch ~]# ./pacclean_1
tar: Removing leading `/' from member names
tar (child): /store/bak/pacman-database.tar.bz2: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
error: no targets specified (use -h for help)
Cache directory: /var/cache/pacman/pkg/
Packages to keep:
All locally installed packages
Do you want to remove all other packages from cache? [Y/n] y
removing old packages from cache...
Database directory: /var/lib/pacman/
Do you want to remove unused repositories? [Y/n] y
Database directory cleaned up
==> MD5sum'ing the old database...
==> Tar'ing up /var/lib/pacman...
==> Making and MD5sum'ing the new database...
==> Syncing database to disk...
==> Checking integrity...
==> Rotating database into place...
==> Finished. Your pacman database has been optimized.
THANKS
12 Year Linux Vet, Don't Let The Post Count Fool Ya! But Sure I Don't Know Everything, Who Does? That's Why I Ask.
Offline
What's with this /store path?
That's the path to file that Meyithi used to create a backup of the database.
The script worked OK for you, nothing to worry about.
Offline
So how would we use it to do that as well?
THANKS
12 Year Linux Vet, Don't Let The Post Count Fool Ya! But Sure I Don't Know Everything, Who Does? That's Why I Ask.
Offline