You are not logged in.

#1 2015-01-10 17:13:14

gunoi
Member
Registered: 2014-07-10
Posts: 5

Pacman error: could not lock database: No space left on device

Hi guys, I was trying to install a package but realized that I was getting this annoying error:

- When trying to remove a package

[root@alex alex]# pacman -R spotify
error: failed to init transaction (unable to lock database)
error: could not lock database: No space left on device

- The same when installing

[root@alex alex]# pacman -S spotify
error: failed to init transaction (unable to lock database)
error: could not lock database: No space left on device

- When updating

[root@alex alex]# pacman -Syu
:: Synchronizing package databases...
error: failed to update core (unable to lock database)
error: failed to update extra (unable to lock database)
error: failed to update community (unable to lock database)
error: failed to update multilib (unable to lock database)
error: failed to synchronize any databases
error: failed to init transaction (unable to lock database)
error: could not lock database: No space left on device 

The thing is that I have enough space. This is my output for df

Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/sda2       20511356  18422440   1023956  95% /
dev              2009316         0   2009316   0% /dev
run              2013444       556   2012888   1% /run
tmpfs            2013444       640   2012804   1% /dev/shm
tmpfs            2013444         0   2013444   0% /sys/fs/cgroup
tmpfs            2013444       184   2013260   1% /tmp
/dev/sda3      458497216 230842932 205320244  53% /home
tmpfs             402692        20    402672   1% /run/user/1000 

I tried to remove the lock after killing all pacman processes but doesn't exists:

[root@alex alex]#  rm /var/lib/pacman/db.lck
rm: cannot remove ‘/var/lib/pacman/db.lck’: No such file or directory

Can you please help?

Offline

#2 2015-01-10 17:22:23

Kopkins
Member
Registered: 2012-07-01
Posts: 189

Re: Pacman error: could not lock database: No space left on device

Your root partition is at 95% use and I believe by default when you format partitions it reserves 5% for root's files. Since the system won't access that last 5%, your root partition for system files is essentially at 100% capacity. So pacman is right there is no space left.

Offline

#3 2015-01-10 17:23:13

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Pacman error: could not lock database: No space left on device

Out of inodes maybe? What does `df -i` say?

Offline

#4 2015-01-10 17:26:02

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

Re: Pacman error: could not lock database: No space left on device

95 % used it too much for safety.  Consider using `ncdu -x /` to locate the excess and clear it.

Some suggestions that are likely not harmful:
1) bleachbit-cli from the AUR or bleachbit from the official repos

# bleachbit --clean system.cache system.localizations system.trash

2) Use paccache to remove old packages.  Pretty safe to keep 2 old versions:

# paccache -vrk 2

3) If systemd's logs are too large limit the size in /etc/systemd/journald.conf --> "SystemMaxUse=500M"

Offline

#5 2015-01-10 18:33:55

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

Re: Pacman error: could not lock database: No space left on device

You don't have to run pacman as root.
Using just '-R' to remove may leave unneeded packages behind.

Offline

#6 2015-01-10 19:44:06

gunoi
Member
Registered: 2014-07-10
Posts: 5

Re: Pacman error: could not lock database: No space left on device

You guys where right. There were no inodes available so I used bleachbit to clean the system a little and it worked. I still don't get why it wasn't possible to remove programs though

Thanks!

Offline

#7 2015-01-10 20:07:39

Kopkins
Member
Registered: 2012-07-01
Posts: 189

Re: Pacman error: could not lock database: No space left on device

Because when pacman starts it checks to see if the lock file exists, if it does, pacman knows that pacman is already running and won't run. If the file doesn't exist, pacman knows that pacman isn't already running and it is safe to proceed. Because you were out of space, there was nowhere to put the file even though you were trying to remove a package.

Offline

Board footer

Powered by FluxBB