Symptoms
When attempting to running any commands through yum or dnf, the command hangs and you get no response.
Cause
In some rare cases, the dnf or yum session can become locked, preventing updates or new installations from being able to progress.
Resolution
- Connect to your server using SSH as the
rootuser - Run the following commands to attempt to fix the issue automatically:
# /scripts/find_and_fix_rpm_issues
# /scripts/check_cpanel_rpms
If running the previous commands does not appear to run or leave your session in a locked state, then you may have some environmental lock files that are preventing the usage of DNF as intended. If they exist, they would be located in the path /var/lib/rpm/ :
CONFIG_TEXT: ls -lah /var/lib/rpm/*.
total 122M
drwxr-xr-x. 2 root root 4.0K Apr 25 11:01 .
drwxr-xr-x. 38 root root 4.0K Apr 25 11:01 ..
-rw-r--r--. 1 root root 0 Sep 18 2017 .dbenv.lock
-rw-r--r--. 1 root root 0 Sep 18 2017 .rpm.lockThe lock files usually have a format of a '.' at the start of the file and end with '.lock.'
- Rename or move these files so they will no longer make an impact:
# mkdir -vp /root/lockfiles/
# mv -v /var/lib/rpm/.dbenv.lock /root/lockfiles/
# mv -v /var/lib/rpm/.rpm.lock /root/lockfiles/
- Once the files are moved, there usually some previous running transactions that would be left behind. You want to clean those up:
# dnf clean all
- And lastly, rebuild the RPM database to ensure that the data is current
# rpm --rebuilddb
- You will be able to confirm DNF is working by performing the following command:
# dnf update
Comments
0 comments
Article is closed for comments.