Can't run yum update? - Could not create lock at /var/run/yum.pid:

I’m trying to run a system update from the command line and keep getting the following error

[root@BotharNimbus ~]# yum update -y
Loaded plugins: fastestmirror, versionlock
Could not create lock at /var/run/yum.pid: [Errno 28] No space left on device


Can't create lock file; exiting
[root@BotharNimbus ~]# ^C
[root@BotharNimbus ~]# df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/SangomaVG-root  207G  8.9G  198G   5% /
devtmpfs                    1.9G     0  1.9G   0% /dev
tmpfs                       1.9G   16K  1.9G   1% /dev/shm
tmpfs                       1.9G  1.9G     0 100% /run
tmpfs                       1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda1                   1.9G  119M  1.7G   7% /boot
tmpfs                       378M     0  378M   0% /run/user/995
tmpfs                       378M     0  378M   0% /run/user/0
[root@BotharNimbus ~]# yum update -y
Loaded plugins: fastestmirror, versionlock
Could not create lock at /var/run/yum.pid: [Errno 28] No space left on device

Clearly shown, you need to clean up /run (which is aliased as /var/run)

1 Like

Stupid question. How does one clean up /var/run

I can’t imagine I just start deleting objects. Thank you

That area should not have a lot of large files. Look around and see if there are any large files, maybe core dumps, which you could delete.

I could get rid of var/run/log which is 192M, that might be enough

If I’m not mistaken, a reboot should clear all of those tmpfs entries.

du -sh * while you are cd into /run may help you find the trouble.

When you see a large directory keep drilling down.

1 Like

Looks to be systemd and logs

[root@BotharNimbus run]# du -sh *
4.0K    asterisk
4.0K    atd.pid
4.0K    auditd.pid
4.0K    avahi-daemon
8.0K    blkid
0       chrony
4.0K    chronyd.pid
0       console
4.0K    crond.pid
0       cron.reboot
0       dbus
0       dmeventd-client
0       dmeventd-server
4.0K    dnsmasq.pid
4.0K    fail2ban
0       faillock
0       fop2.ctl
4.0K    fop2.pid
8.0K    httpd
4.0K    incrond.pid
4.0K    initramfs
0       lock
193M    log
0       lvm
4.0K    lvmetad.pid
4.0K    mariadb
0       mdadm
4.0K    mongodb
0       mount
0       netreport
0       openvpn-client
0       openvpn-server
4.0K    openvpn-server.log
0       plymouth
0       radiusd
0       redis
0       rpcbind
0       rpcbind.lock
0       rpcbind.sock
0       screen
0       sepermit
0       setrans
4.0K    sshd.pid
0       sudo
4.0K    syslogd.pid
1.7G    systemd
4.0K    tmpfiles.d
4.0K    tuned
280K    udev
0       user
4.0K    utmp
0       wpa_supplicant
4.0K    xinetd.pid
0       xtables.lock
0       yum.pid

Drill down into the systemd directory…

It is the sessions file

[root@BotharNimbus sessions]# cd /var/run/systemd
[root@BotharNimbus systemd]# du -sh *
0       ask-password
0       ask-password-block
0       cgroups-agent
12K     generator
24K     generator.late
0       inaccessible
0       initctl
4.0K    journal
0       machines
0       netif
0       notify
0       private
4.0K    readahead
4.0K    seats
1.7G    sessions
0       shutdown
0       shutdownd
272K    system
0       users

https://forums.centos.org/viewtopic.php?t=65472

As @cynjut suggested, time to reboot.

3 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.