You are not logged in.

#1 2012-04-27 13:22:25

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

Pacman ignores writable cache, uses /tmp. Due to cache permissions

Hi, I had a problem today that wasted a bit of time so I thought it worth posting here. Let me know if I should raise this as a bug.

I noticed that my pacman cache wasn't being found when doing an update.

Doing "pacman -Syu" gave a warning "couldn't find or create package cache, using /tmp instead".

However, I have a cache at /var/cache/pacman/pkg and I have confirmed that it's writeable and I have checked that I have nothing in my /etc/pacman.conf to change from the default cache.

Even doing "pacman --cachedir /var/cache/pacman/pkg -Syu" didn't help.

When I used "--debug" I saw this:

debug: skipping cachedir, no write bits set: /var/cache/pacman/pkg/
debug: option 'cachedir' = /tmp/
debug: using cachedir: /tmp/
warning: couldn't find or create package cache, using /tmp/ instead

Which caused me to further investigate writing to the directory. All these tests worked - it was there and I could write to it. I then checked the permissions. There were none, it was "d---------". When I changed this to 755 all started working. I don't know what caused its permissions to be wiped.

Now, the permissions were wrong, I admit, but as root can write anyway it seems rather odd that this stops pacman from useing it. I notice that lipalpm explicitly checks the permissions after a patch was applied in 2011.

I think it would help if pacman provided the reason why the cache is not used rather than just saying "couldn't find or create package cache".

I'll raise a bug report if it's worthwhile.

Offline

Board footer

Powered by FluxBB