[LINUX] yum / rpm command freezes

Preface

The yum command install, search, and info all stop. It works when I don't sudo for some reason. Installation with rpm also stops. why!

answer

First of all, how did you get over?

rm /var/lib/rpm/.rpm.lock
rm /var/lib/rpm/.dbenv.lock
rm /var/lib/rpm/__db*
rpm --rebuilddb -vv   
yum clean all

Background

sudo yum install httpd

Shin

Even if I refer to this answer, it doesn't heal. https://superuser.com/a/518252

This wasn't enough.


rm /var/lib/rpm/__db*
rpm --rebuilddb -vv   
yum clean all

Harden.

Not one of the repositories is wrong The yum error message is empty.

Is it possible to install with the rpm command instead of yum? I thought

sudo rpm -ivhv ***.rpm

↑ -vv will give a detailed log

The log is

D: ============== ./***.rpm
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
D:loading keyring from rpmdb ← Stop here.

It won't come back forever. The error is not perfect either.

I wonder why ~~

If you think

/var/lib/rpm/Below. There is something


...
-rw-r--r--  1 root root    0 Dec 26 16:52 .dbenv.lock
-rw-r--r--  1 root root    0 Dec 26 16:52 .rpm.lock
...

Can I erase this? When I googled, there was a stackoverflow that was deleted, so I implemented it.

It was repaired safely. Now put Ansible in ... Gufufu

Summary

(This is a rule of thumb) Let's look at the directory where the commands are located.

If the path passes, the location of the command file will be displayed.


whereis rpm

If the pattern is that you have added python3, please hit the other.

bonus

One-liner command to kill when yum freezes


pgrep yum | xargs sudo kill -9

Recommended Posts

yum / rpm command freezes
yum and rpm