Não é possível usar o yum no CentOS 7

Não é possível usar o yum no CentOS 7

Instalei o CentOS 7 no hyper-v com sucesso, mas quando tento atualizar usando yum update ou tento instalar usando o yumcomando, recebo o erro abaixo:

Loaded plugins: fastestmirror, langpacks Could not retrieve mirrorlist
http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock
error was 12: Timeout on
http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock:
(28, 'Resolving timed out after 30425 milliseconds')


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. Disable the repository, 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>

      4. 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/7/x86_64`

Responder1

(28, 'Resolving timed out after 30425 milliseconds')

Isso significa que sua VM provavelmente não possui um servidor DNS funcional. Resolver aqui refere-se à resolução de um nome de domínio para um endereço IP.

Tente executar ping em google.com ou mirrorlist.centos.org para ver se você tem alguma funcionalidade de DNS. Os servidores DNS usados ​​atualmente estão listados em/etc/resolv.configual a:

nameserver 8.8.8.8
nameserver 8.8.4.4

Se o/etc/resolv.confestá vazio, tente primeiro executar ping nos endereços IP acima (DNS público do Google) e depois adicione-os ao/etc/resolv.confarquivo como acima para começar a usar o DNS do Google. Para tornar isso uma correção permanente, você pode usar a ferramenta de configuração de rede CentOS 7 para configurar os servidores DNS corretamente. Aqui está um artigo decente sobre como fazer isso:http://www.krizna.com/centos/setup-network-centos-7/

Responder2

Use ip routepara ver para qual rota padrão de IP está indo, se nada ficar visível, então você precisa obter um novo IP, o que pode ser feito por

sudo dhclient

Isso deve resolver o problema. Tente yum updateagora.

Responder3

É o problema do ipv6. Desative o ipv6 da execução.

lsmod | grep -i ipv6
sysctl --all
nslookup google.com
systemctl stop NetworkManager
systemctl disable NetworkManager
cd /etc/default

change line to : GRUB_CMDLINE_LINUX="ipv6.disable=1 rd.lvm.lv=centos/swap vconsole.font=latarcyrh

grub2-mkconfig -o /boot/grub2/grub.cfg
vi grub
ip addr

nota: adicione desativar comando no grub

Responder4

Localize o arquivo "/etc/sysconfig/network-scripts/ifcfg-enp0s17". **O nome do arquivo pode variar de acordo com o ambiente. 1.Localize as linhas: BOOTPROTO=none ONBOOT=no

  1. mude para BOOTPROTO=dhcp ONBOOT=yes salvar + sair

  2. execute "systemctl reiniciar rede"

informação relacionada