Yum исправить ошибки


Исправление ошибки yum в CentOS

2015-03-30

2 минуты read (About 247 words)

Исправление ошибки Error: database disk image is malformed

Загружены модули: fastestmirror, refresh-packagekit
Приготовления к процессу обновления
Loading mirror speeds from cached hostfile
* PUIAS_6_computational: www.puias.princeton.edu
* base: mirror.h1host.ru
* centosplus: mirror.h1host.ru
* epel: mirror.logol.ru
* extras: mirror.h1host.ru
* rpmforge: ftp.nluug.nl
* updates: mirror.h1host.ru
Error: database disk image is malformed

Проблема решается следующими действиями:


Загружены модули: fastestmirror, refresh-packagekit
Сброс источников:PUIAS_6_computational adobe-linux-x86_64 ajenti base centosplus epel extras isv_ownCloud_community nginx rpmforge updates
25 sqlite файлы удалены
yum history new
Загружены модули: fastestmirror, refresh-packagekit
history new

Комментарии

In this article, I will take you through different methods through which you can fix broken packages in RHEL/CentOS. Sometimes you might have noticed that whenever you try to run any update or try to install a new package in your RHEL/CentOS Systems, you get broken package error. This error does not allow you to proceed with the update or installation hence causing a road block. While this can happen due to multiple reason, we will see all the possible solution in below section that you can take to solve this error. So without any further delay let’s us start !!

What are Broken Packages

Whenever you try to install a list of packages then sometimes it may happen that few of the packages either did not installed properly or get partially installed due to some unexpected reason, those packages are usually called broken packages.

How to Fix Broken Packages in RHEL/CentOS 7/8{Easy Methods}

Also Read: How to Install VLC Media Player in Debian 11

Method 1: Using rpm command

First you need to verify all the packages with information about the files taken from the package metadata stored in the rpm database using rpm -Va command as shown below. More about rpm command.

[root@localhost ~]# rpm -Va
.M....... g /var/lib/PackageKit/transactions.db
missing /run/gluster
.M....... g /etc/crypto-policies/back-ends/nss.config
.M....... g /etc/udev/hwdb.bin
.M....... g /var/lib/systemd/random-seed
.M....... d /usr/share/info/dir.old
.M....G.. /var/log/gdm
.M....... c /etc/rc.d/rc.local
.....UG.. g /var/run/avahi-daemon
.M....... g /var/cache/dnf/packages.db
.M....... g /run/dbus

Method 2: Using dnf command

Another method to solve the problem of broken package issue is by running upgrade with -b option so that it will force dnf to only consider the latest version.

[root@localhost ~]# dnf upgrade -b
CentOS-8 - AppStream 4.3 kB/s | 4.3 kB 00:01
CentOS-8 - AppStream 2.4 MB/s | 9.3 MB 00:03
CentOS-8 - Base 7.3 kB/s | 3.9 kB 00:00
CentOS-8 - Base 1.8 MB/s | 7.5 MB 00:04
CentOS-8 - Extras 1.9 kB/s | 1.5 kB 00:00
CentOS-8 - Extras 13 kB/s | 10 kB 00:00
Dependencies resolved.

If you have any specific broken package then you can try to reinstall that package by using dnf --refresh reinstall package_name command as shown below.

[root@localhost ~]# dnf --refresh reinstall package_name 

Method 3: Using yum command

If you are facing any broken package error while running a yum command then you can try to reinstall all the packages using yum reinstall * command.

[root@localhost ~]# yum reinstall *
Last metadata expiration check: 0:50:37 ago on Sat 16 Oct 2021 02:34:37 AM EDT.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Reinstalling:
GConf2 x86_64 3.2.6-22.el8 AppStream 1.0 M
adobe-mappings-cmap noarch 20171205-3.el8 AppStream 2.1 M
adobe-mappings-cmap-deprecated noarch 20171205-3.el8 AppStream 119 k
adobe-mappings-pdf noarch 20180407-1.el8 AppStream 707 k
adwaita-cursor-theme noarch 3.28.0-2.el8 AppStream 647 k

If yum is unable to repair then you can skip those packages by using --skip-broken option.

[root@localhost ~]# yum update --skip-broken
Last metadata expiration check: 0:54:46 ago on Sat 16 Oct 2021 02:34:37 AM EDT.
Dependencies resolved.
=============================================================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================================================
Installing:
centos-linux-release noarch 8.4-1.2105.el8 BaseOS 22 k
replacing centos-release.x86_64 8.1-1.1911.0.8.el8
replacing centos-repos.x86_64 8.1-1.1911.0.8.el8
kernel x86_64 4.18.0-305.19.1.el8_4 BaseOS 5.9 M
kernel-core x86_64 4.18.0-305.19.1.el8_4 BaseOS 36 M
kernel-modules x86_64 4.18.0-305.19.1.el8_4 BaseOS 28 M
Upgrading:
PackageKit x86_64 1.1.12-6.el8 AppStream 599 k

BEFORE TRYING ANY OF THIS, HAVE A BACKUP OF YOUR MACHINE, YOU COULD DAMAGE YOUR OS MORE/COMPLETELY

It seems that your yum variable $releasever is somehow corrupt,
it usually is caused by missing centos-release package on the machine for some obscure reasons.

You can check if you have the package by:

    rpm -qi centos-release

You will probably see:

    "package centos-release is not installed"

First find out the exact centos version that you have by executing as root:

    cat /etc/redhat-release

You will see something like this:

    CentOS Linux release 7.3.1611 (Core)

You can fetch the centos-release package from repo by:

    wget http://vault.centos.org/centos/7.3.1611/updates/x86_64/Packages/centos-release-7-3.1611.el7.centos.2.5.x86_64.rpm

Now run reinstall centos-release package via rpm:

    sudo rpm -Uvh --replacepkgs centos-release-7-3.1611.el7.centos.2.5.x86_64.rpm

As next you can try to install something with yum and you might get:

    [root@dcos-master3 ikerlan]# sudo yum install wget
    error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch
    error: cannot open Packages index using db5 - (-30969)
    error: cannot open Packages database in /var/lib/rpm
    CRITICAL:yum.main:

    Error: rpmdb open failed

Now you can try to reboot the machine or try to use the following command to rebuild the rpm db:

    rpm --rebuilddb

Сегодня я ударился головой о стену, чтобы найти решение следующей загадочной проблемы. Всякий раз, когда я запускаю любую команду в терминале, будь то установка пакета или обновление системы, моя минимальная система CentOS 7 породила следующую ошибку:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * elrepo: ftp.nluug.nl
 * extras: mirrors.vonline.vn
 * updates: mirrors.vonline.vn
Traceback (most recent call last): 27% [================ ] 140 kB/s | 2.5 MB 00:00:48 ETA 
 File "/usr/libexec/urlgrabber-ext-down", line 75, in 
 main()
 File "/usr/libexec/urlgrabber-ext-down", line 61, in main
 fo = PyCurlFileObject(opts.url, opts.filename, opts)
 File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1258, in __init__
 self._do_open()
 File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1589, in _do_open
 self._do_grab()
 File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1723, in _do_grab
 self._do_perform()
 File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1517, in _do_perform
 raise KeyboardInterrupt
KeyboardInterrupt

Exiting on user cancel

Я не отменяю процесс и не прерываю клавиатуру, но моя виртуальная машина CentOS 7 продолжала показывать вышеприведенную ошибку.

Я много раз пробовал, но я не мог устанавливать какие-либо пакеты или обновлять систему.

К счастью, я нашел решение

Вот что я сделал для решения проблемы.

С вашего терминала выполните следующие команды один за другим в качестве пользователя root:

yum clean metadata
yum clean all
yum upgrade

Или просто запустите команду «одной строкой» как пользователь root:

bash -c 'yum clean metadata && yum upgrade'

[Errno 14] HTTP/HTTPS Error 404

[Errno 14] PYCURL ERROR 22 — «The requested URL returned error: 403»

[Errno 14] Error 60 — It was impossible to connect to the CentOS servers

Summary

When trying to install or update packages using yum on client systems, yum is failing with one of the following errors:

[Errno 14] HTTP Error 404: Not Found
[Errno 14] HTTPS Error 404 - Not Found
[Errno 14] HTTP Error 404: Status 404
[Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403"
[Errno 14] Error 60 - It was impossible to connect to the CentOS servers

Leading Causes

1. You are not connected to the internet.

2. This issue can also occur if the system is able to communicate with given server but could not find or access the requested package or path on the server.

3. You have a misconfigured proxy server.

4. You have a local mirror with issues.

Fixes

1. Validate the system can see things on the internet.

2. This issue can also occur due to corruption of the local machine cache, try to clear cache on system:

yum clean all
rm -rf /var/cache/yum/*

3. If you have a proxy server, validate it is configured properly in /etc/yum.conf. Here is an example (your names, passwords, and port numbers will obviously be different).

proxy=http://mystuff.mydomain.com:1234
# Account details for yum connections
proxy_username=proxy-user
proxy_password=proxy-password

4. Temporarily comment out the mirror= line in the the .repo file, then:

yum clean all; yum makecache

If that does not work or if you still need help, try one of our community help platforms:

Forums | Mailing Lists | Other — Getting Help

Понравилась статья? Поделить с друзьями:

Не пропустите эти материалы по теме:

  • Яндекс еда ошибка привязки карты
  • Yt cm08 8b ru коды ошибок
  • Youtube произошла ошибка повторите попытку на телефоне
  • Youtube ошибка сервера 400 android
  • Youtube pink ошибка сервера 400

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии