You are not logged in.

#1 2014-12-31 09:13:00

kynikos
Wiki Admin
Registered: 2010-12-28
Posts: 170

[solved] pacman 4.2 upgrade and paccache

(I haven't managed to find this mentioned anywhere, however I doubt I'm the only one affected by this, so apologies if this was reported somewhere else)

I've just upgraded to pacman 4.2. Usually after a system upgrade I run:

$ paccache -rvv && paccache -ruvvk0

(yes, with an alias tongue) Unfortunately this time it completely cleared my cache, because pacman's database should have been upgraded first with:

# pacman-db-upgrade

I was wondering if there is a reason why we didn't get a news entry to warn about this, unlike e.g. archlinux.fr.

EDIT: Maybe a better solution would be to make paccache check whether it can read pacman's database before attempting to do anything; is there anyone that thinks this is worth a bug report?

Last edited by kynikos (2015-01-13 06:05:09)

Offline

#2 2014-12-31 13:28:41

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [solved] pacman 4.2 upgrade and paccache

Cleaning the cache immediately after an update is very bad practice. I've done it a few times and always regretted it right away when it turned out I had to downgrade something because the update was buggy, but now the old package I wanted to downgrade to was gone from the cache. Don't do this!

Pick a quiet day without major updates and make sure the system is running perfectly fine as it is without downgrades in sight (i.e. also take the time to test applications you use infrequently!). Then clean the cache.

Offline

#3 2014-12-31 14:08:00

kynikos
Wiki Admin
Registered: 2010-12-28
Posts: 170

Re: [solved] pacman 4.2 upgrade and paccache

Eheh `paccache -rvv` removes all but the last 3 versions of each package in the cache; `paccache -ruvvk0` removes all the cached versions of uninstalled packages instead. You can see `paccache -h`for all the options. (Edit: If I really deliberately cleared the cache after every upgrade I wouldn't have even started this thread in the first place wink )

Last edited by kynikos (2014-12-31 14:10:09)

Offline

#4 2014-12-31 15:02:08

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] pacman 4.2 upgrade and paccache

I deal with pacnew files, pacman-db-upgrade, any syslinux or mkinitcpio issues that crop up when updating my system before doing anything else. Maybe your way of doing things just falls under 'unsupported' i.e. you're on your own.

Try asking on the ML or report a bug / feature request.

Offline

#5 2014-12-31 15:17:20

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: [solved] pacman 4.2 upgrade and paccache

No issues here but I don't run paccache on an update, I run with my bleachbit alias.  In this case, I knew in advance that the db needed to get updated... perhaps pacman's post_install scriptlet should warn users to update the db ASAP to avoid these issues.  Perhaps a bug report is in order.

Offline

#6 2014-12-31 16:24:05

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [solved] pacman 4.2 upgrade and paccache

graysky wrote:

perhaps pacman's post_install scriptlet should warn users to update the db ASAP to avoid these issues.  Perhaps a bug report is in order.

If you run a `pacman -Syu` after the update, that advice is given by pacman after the database keyring check fails.


Jin, Jîyan, Azadî

Offline

#7 2015-01-01 00:21:19

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] pacman 4.2 upgrade and paccache

Head_on_a_Stick wrote:
graysky wrote:

perhaps pacman's post_install scriptlet should warn users to update the db ASAP to avoid these issues.  Perhaps a bug report is in order.

If you run a `pacman -Syu` after the update, that advice is given by pacman after the database keyring check fails.

The message is:

error: failed to initialize alpm library
(database is incorrect version: /var/lib/pacman/)
error:   try running pacman-db-upgrade

Offline

#8 2015-01-01 04:15:17

kynikos
Wiki Admin
Registered: 2010-12-28
Posts: 170

Re: [solved] pacman 4.2 upgrade and paccache

Head_on_a_Stick wrote:

perhaps pacman's post_install scriptlet should warn users to update the db ASAP to avoid these issues.  Perhaps a bug report is in order.

graysky wrote:

If you run a `pacman -Syu` after the update, that advice is given by pacman after the database keyring check fails.

Yep, the problem is that paccache doesn't exit in case of error, but thinks that an incompatible database is an empty one, so I've indeed reported FS#43286.

Offline

#9 2015-01-01 15:32:18

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: [solved] pacman 4.2 upgrade and paccache

kynikos wrote:

Eheh `paccache -rvv` removes all but the last 3 versions of each package in the cache;

Yes, if it works correctly. But as you just found out, sometimes it fails. So my original point (test your system carefully before you clean the cache) still stands, whether you use paccache or pacman -Sc.

Offline

#10 2015-01-01 15:41:53

progandy
Member
Registered: 2012-05-17
Posts: 5,317

Re: [solved] pacman 4.2 upgrade and paccache

Morn wrote:
kynikos wrote:

Eheh `paccache -rvv` removes all but the last 3 versions of each package in the cache;

Yes, if it works correctly. But as you just found out, sometimes it fails. So my original point (test your system carefully before you clean the cache) still stands, whether you use paccache or pacman -Sc.

This command should not depend on the pacman database: paccache -rvv
The problems start when using paccache -ruvvk0. If pacman doesn't return the list of installed packages, this command removes everything instead of only uninstalled packages.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#11 2015-01-02 01:52:20

amish
Member
Registered: 2014-05-10
Posts: 513

Re: [solved] pacman 4.2 upgrade and paccache

May be next time, you may want to try paccache -dvv before doing paccache -rvv.

Btw I agree that "post_install of pacman" there should be message.

You can not assume that user will figure it out on his own when ERROR occurs the next time.

Offline

#12 2015-01-02 14:10:13

kynikos
Wiki Admin
Registered: 2010-12-28
Posts: 170

Re: [solved] pacman 4.2 upgrade and paccache

Thank you everybody, I've submitted a patch in the bug report: https://bugs.archlinux.org/task/43286#comment131174
If somebody wants to help review it, please comment there.

Edit: the patch was applied.

Last edited by kynikos (2015-01-13 06:05:43)

Offline

Board footer

Powered by FluxBB