You are not logged in.

#1 2009-03-19 15:29:50

insulae
Member
From: Sgo del Estero - Argentina
Registered: 2007-06-08
Posts: 52
Website

howto to remove only old versions packages with pacman

(first: sorry for my english :D)

i have 2 Archlinux installed in my machine:

/dev/sda1 with Archlinux+Xfce
/dev/sda2 with Archlinux+KDE4

i don't want download the same package twice, so i put /var/cache/pacman/pkg into /dev/sda3 and i linked the folder to /dev/sda1 and /dev/sda2, everything work perfectly, but i have (a example) 4 versions of the package openoffice-base-beta (version _m6, _m5, _m4, _m3) so, my pacman/pkg is to big, i want to clean, but if i use:

pacman -Sc

from Archlinux+Xfce iam going to remove all packages of KDE and if i run this from Archlinux+KDE i am going to remove all packages of Xfce.
i want a command (if exist) what remove only old version and keep the most recently.
Why a want this?, i am testing KDE4, but my production desktop is Xfce, and i dont want mix, and my conection is not so good to use the comand "pacman -Sc or pacman -Scc".

Grettings
insulae

Offline

#2 2009-03-19 15:33:23

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: howto to remove only old versions packages with pacman

See CleanMethod in man pacman.conf.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#3 2009-03-19 16:43:44

insulae
Member
From: Sgo del Estero - Argentina
Registered: 2007-06-08
Posts: 52
Website

Re: howto to remove only old versions packages with pacman

rson451 solution:

       CleanMethod = KeepInstalled | KeepCurrent
           If set to KeepInstalled (the default), the -Sc operation will clean packages that are no longer installed (not present in the local database). If set to KeepCurrent, -Sc will clean outdated
           packages (not present in any sync database). The second behavior is useful when the package cache is shared among multiple machines, where the local databases are usually different, but the
           sync databases in use could be the same.

thanks man, this is i want big_smile.

Offline

#4 2009-05-03 13:34:13

cpc
Member
Registered: 2009-04-30
Posts: 42

Re: howto to remove only old versions packages with pacman

Is it necessary to keep these installed packages in /var/cache/pacman/pkg ?
if not, how can I remove all of them?

By the way, I find in /etc/pacman.conf the line CleanMethod = KeepInstalled is commented by default, so when I run pacman -Sc, it does remove some packages but not all.

Thanks for reply.

Offline

#5 2009-05-03 13:38:15

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,385
Website

Re: howto to remove only old versions packages with pacman

I believe KeepInstalled is the default.   To remove all packages use "pacman -Scc".  This will make it more difficult if you want to downgrade something in the future...

Offline

#6 2009-05-03 13:42:54

cpc
Member
Registered: 2009-04-30
Posts: 42

Re: howto to remove only old versions packages with pacman

I always backup my system periodically, so there is less possibility to downgrade something, many thanks for your tip, it is useful.

Offline

Board footer

Powered by FluxBB