You are not logged in.

#1 2016-02-07 02:41:01

sgillespie
Member
Registered: 2012-12-28
Posts: 32

[Solved] Pacman: could not open database: /var/lib/pacman/

When I run as root, everything works fine

sudo pacman -v
Root      : /
Conf File : /etc/pacman.conf
DB Path   : /var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/  
Hook Dirs : /usr/share/libalpm/hooks/  /etc/pacman.d/hooks/  
Lock File : /var/lib/pacman/db.lck
Log File  : /var/log/pacman.log
GPG Dir   : /etc/pacman.d/gnupg/
Targets   : None
error: no operation specified (use -h for help)

But when I run as a regular user

pacman -v
error: failed to initialize alpm library
(could not open database: /var/lib/pacman/)

Interestingly, /var/lib/pacman/local has 700 permissions, but even if I change it (to 755), I get

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

Running pacman-db-upgrade does not seem to do anything

Last edited by sgillespie (2016-02-07 15:01:11)

Offline

#2 2016-02-07 10:02:56

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,691
Website

Re: [Solved] Pacman: could not open database: /var/lib/pacman/

Why did /var/lib/pacman/local have 700 permissions? Do any other directories leading up to, and beyond that path have incorrect permissions?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2016-02-07 15:00:33

sgillespie
Member
Registered: 2012-12-28
Posts: 32

Re: [Solved] Pacman: could not open database: /var/lib/pacman/

I have no idea why it was wrong; I did, however, find that ALPM_DB_VERSION was incorrect, I fixed it with

sudo chmod 644 /var/lib/pacman/local/ALPM_DB_VERSION

Offline

#4 2016-04-11 06:46:59

markc
Member
From: Gold Coast, Australia
Registered: 2007-05-15
Posts: 502
Website

Re: [Solved] Pacman: could not open database: /var/lib/pacman/

@sgillespie thank you, I've been looking for a couple of days for this simple solution!

Offline

Board footer

Powered by FluxBB