Cannot Install Software via yum

Support for security such as Firewalls and securing linux
Post Reply
Michael314
Posts: 3
Joined: 2020/07/29 12:15:11

Cannot Install Software via yum

Post by Michael314 » 2023/10/03 17:52:03

Hello,

I was able to perform a new CentOS 7 install and perform and full update via: yum update -y.

However, if I try to install a new package via yum install telnet -y I get the following error:
[root@mlblcalabdedv01 ~]# yum install telnet -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7 ... nfra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"


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/7/x86_64
What can you recommend?

Thank you,

Michael

User avatar
TrevorH
Site Admin
Posts: 33224
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot Install Software via yum

Post by TrevorH » 2023/10/03 22:19:10

Fix your DNS resolution. Start by checking /etc/resolv.conf syntax.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4532
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Cannot Install Software via yum

Post by jlehtone » 2023/10/04 07:45:33

Could not resolve host: mirrorlist.centos.org
Network communication has to translate (resolve) human-readable names, like "mirrorlist.centos.org",
into IP address because routers do use the numeric addresses to direct traffic to correct destination.
For some reason your system has an error in the resolution. With no address the curl cannot talk to that server.


Please avoid the -y option for yum. It is easy to enter 'y' when yum shows what it will do,
but it is harder to undo what the "Automatically answer yes for all questions" option can get you into.

Michael314
Posts: 3
Joined: 2020/07/29 12:15:11

Re: Cannot Install Software via yum

Post by Michael314 » 2023/10/06 11:31:06

jlehtone,TrevorH,

Thank you!

I thought I configured the resolv.conf but somehow it was not or wiped. That fixed it!

So no other process would nuke it, I set it as IMMUTABLE: chattr +i /etc/resolv.conf

This forum is invaluable.

-Michael

User avatar
jlehtone
Posts: 4532
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Cannot Install Software via yum

Post by jlehtone » 2023/10/06 12:51:56

The default network setup on CentOS 7 is with NetworkManager.service (NM)
and NM does use DHCP for configuring the connections. One bit of that is the
DNS configuration and that updates the /etc/resolv.conf (by default).

The NM can be configured to not touch the /etc/resolv.conf, which is ok when
the DNS config remains "static"; does not need to be changed.

I don't know what NM says about the immutable.

Post Reply