Could not retrieve mirrorlist

General support questions
Post Reply
sadue
Posts: 55
Joined: 2016/01/08 19:08:26

Could not retrieve mirrorlist

Post by sadue » 2016/01/08 19:40:36

Hey

I just purchased a vps for the first time, trying to install some necessary application on it, but on my first code to install httpd, i got the following error;

Code: Select all

Loaded plugins: fastestmirror
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=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. 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
Please what should I do? Am running Centos Linux 7.
Just as I said, am a newbie to all these things. What am good at is copy and paste code to execute the required command as directed.
Attachments
Screenshot of the error on SSH
Screenshot of the error on SSH
repository error.PNG (35.19 KiB) Viewed 193378 times

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

Re: Could not retrieve mirrorlist

Post by TrevorH » 2016/01/08 21:19:34

Your dns isn't working. Check /etc/resolv.conf for valid and accessible nameserver lines. Use 8.8.8.8 if needs be.
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

sadue
Posts: 55
Joined: 2016/01/08 19:08:26

Re: Could not retrieve mirrorlist

Post by sadue » 2016/01/08 22:41:28

Hey TrevorH

Thanks for the prompt respond.
Just as I said earlier, am a newbie to all these stuff. Giving to the DNS, I have not initially done anything there before, which I understand that there is need to set things up for the DNS, Could you help me with directives on what exactly to do?
while searching for more details on this, a lot of tutorial where pointing on installing BIND, is that what it actually needed?

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

Re: Could not retrieve mirrorlist

Post by TrevorH » 2016/01/09 01:41:26

You don't want to install bind. You just need to point the system to a working nameserver and the easiest (at least to test) is to use Google's 8.8.8.8 public DNS server. Just add a line to /etc/resolv.conf saying "nameserver 8.8.8.8"
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

sadue
Posts: 55
Joined: 2016/01/08 19:08:26

Re: Could not retrieve mirrorlist

Post by sadue » 2016/01/09 07:45:53

Thank you @Trevorh
It really worked. After installing httpd, I tried ran the comand

Code: Select all

chkconfig --levels 3 httpd on
but I received the bellow message;
[root@server2 ~]# chkconfig --levels 3 httpd on
Note: Forwarding request to 'systemctl enable httpd.service'.
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
Is it normal, or is there a precaution I need to take, or an adjustment to make? and what level is most suitable for production site?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Could not retrieve mirrorlist

Post by gerald_clark » 2016/01/14 16:48:57

CentOS 7 does not use chkconfig, so it was re-dirrected to the proper command.
CentOS 7 is VERY different than CentOS 6.
You should spend some time reading the manuals.
https://access.redhat.com/documentation/en/

sibomarie
Posts: 1
Joined: 2016/09/13 12:10:46

Re: Could not retrieve mirrorlist

Post by sibomarie » 2016/09/13 12:14:48

TrevorH wrote:You don't want to install bind. You just need to point the system to a working nameserver and the easiest (at least to test) is to use Google's 8.8.8.8 public DNS server. Just add a line to /etc/resolv.conf saying "nameserver 8.8.8.8"

This answer solved my issue. Thanks :D

Post Reply