2017-02-09 17 views
0

Я пытаюсь установить пакет на CentOS, но он вызывает ошибку при запуске команды «yum». Интернет-соединение работает нормально. Я пытаюсь yum очистить все, но проблема сохраняется.centos yum не удалось установить что-либо или обновить систему

Ошибка:

[[email protected] ~]# yum install ntp 

Loaded plugins: fastestmirror 


    One of the configured repositories failed (Unknown), 
    and yum doesn't have enough cached data to continue. At this point the only 
    safe thing yum can do is fail. There are a few ways to work "fix" this: 

     1. Contact the upstream for the repository and get them to fix the problem. 

     2. Reconfigure the baseurl/etc. for the repository, to point to a working 
      upstream. This is most often useful if you are using a newer 
      distribution release than is supported by the repository (and the 
      packages for the previous distribution release still work). 

     3. Run the command with the repository temporarily disabled 
       yum --disablerepo=<repoid> ... 

     4. Disable the repository permanently, so yum won't use it by default. Yum 
      will then just ignore the repository until you permanently enable it 
      again or use --enablerepo for temporary usage: 

       yum-config-manager --disable <repoid> 
      or 
       subscription-manager repos --disable=<repoid> 

     5. Configure the failing repository to be skipped, if it is unavailable. 
      Note that yum will try to contact the repo. when it runs most commands, 
      so will have to try and fail each time (and thus. yum will be be much 
      slower). If it is a very temporary problem though, this is often a nice 
      compromise: 

       yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true 

    Cannot find a valid baseurl for repo: base/$releasever/x86_64 

Мои ни repolist является следующим:

[[email protected] ~]# yum repolist list 
Loaded plugins: fastestmirror 
https://yum.dockerproject.org/repo/main/centos/%24releasever/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden 
Trying other mirror. 
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/solutions/69319 

If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/ 

repolist: 0 

Если я перечислить repolist:

[[email protected] ~]# yum repolist 
Loaded plugins: fastestmirror 
https://yum.dockerproject.org/repo/main/centos/%24releasever/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden 
Trying other mirror. 
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/solutions/69319 

If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/ 

repo id        repo name        status 
base/$releasever/x86_64    CentOS-$releasever - Base    0 
dockerrepo/$releasever    Docker Repository      0 
extras/$releasever/x86_64   CentOS-$releasever - Extras   0 
updates/$releasever/x86_64   CentOS-$releasever - Updates   0 
repolist: 0 
+0

Список репозиций с командой «yum repolist» и публикация результатов, которые вы пытались перечислить в списке «yum repolist list», но похоже, что что-то не так с репозиторией докеров –

+0

Спасибо! Я добавляю вывод в описание. Вы можете проверить? @MichalHainc –

+0

Эта команда показывает некоторую информацию? cat /etc/yum.repos.d/docker.repo –

ответ

1

, прежде чем пытаться любым из этого, иметь резервный ВАША МАШИНА, ВЫ МОЖЕТЕ ПОВРЕЖДАТЬ ВАШУ ОС БОЛЬШЕ/ПОЛНОСТЬЮ

Кажется, что ваш yum variable $ releasever как-то поврежден, обычно вызван отсутствием пакета centos-release на машине по некоторым неясным причинам.

Вы можете проверить, если у вас есть пакет по:

rpm -qi centos-release 

Вы, вероятно, увидеть:

"package centos-release is not installed" 

сначала выяснить точную версию CentOS, что у вас есть, выполнив в корне:

cat /etc/redhat-release 

Вы увидите примерно следующее:

CentOS Linux release 7.3.1611 (Core) 

Вы можете получить пакет CentOS-релиз от репо по:

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 

Теперь запустите переустанавливать пакет CentOS-релиз с помощью оборотов в минуту:

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

В следующем вы можете попробовать установить что-то с yum, и вы можете получить:

[[email protected] 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 

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

rpm --rebuilddb 
0

Я столкнулся с этой проблемой при попытке установить MariaDB на CentOS 7. Я был очень расстроен и после долгих поисков нашел ответ на этот link ,

Вот что исправила эту проблему для меня. Запуск от имени root.

# yum --disablerepo "*" --enablerepo epel install [package] 
# yum clean all 

«epel» может быть любым репо, которое вам нравится, но этот работал для меня. Поместите [пакет] в команду так же, как написано, а не какой пакет, который вы пытаетесь установить.

После запуска вышеуказанного выйдите из корня и запустите любую установку, которую вы пытались, перед тем как встретить ошибку.