CentOS 7 solution to the Internet after installation

Source: Internet
Author: User

Problem found:

[Root@mydocker network-scripts]# wget Http://mirrors.163.com/.help/CentOS7-Base-163.repo
--2016-10-01 09:43:12--Http://mirrors.163.com/.help/CentOS7-Base-163.repo
Resolving host mirrors.163.com (mirrors.163.com) ... Failure: unknown name or service.
Wget: Unable to resolve host address "mirrors.163.com"
[Root@mydocker network-scripts]# Yum Update
Loaded plugins: Fastestmirror, LangPacks
Http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno] curl#6-"Could not resolve host: mirrors.163.com; Unknown error "
Attempting another mirror.




One of the configured repositories failed (CentOS-7-base-163.com),
and Yum doesn ' t have enough cached data to continue. At the
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 are 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 would then
Just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:


Yum-config-manager--disable Base


4. Configure the failing repository to being skipped, if it is unavailable.
Note that Yum would try to contact the repo. When it runs most commands,
So'll have to try and fail each time (and thus. Yum would be too much
Slower). If It is a very temporary problem though, which is often a nice
Compromise:


Yum-config-manager--save--setopt=base.skip_if_unavailable=true


Failure:repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
Http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno] curl#6-"Could not resolve host: mirrors.163.com; Unknown error "


Positioning problem:

According to the above error hint, should be domain name resolution is not, then we need to set CentOS 7 domain name resolution rule.


Workaround:

Add a line to the/etc/resolv.conf file as:/etc/resolv.conf, as follows:

[Root@mydocker yum.repos.d/etc/resolv.conf]# cat/etc/resolv.conf
NameServer 8.8.8.8


Verify:

[Root@mydocker network-scripts]# wget Http://mirrors.163.com/.help/CentOS7-Base-163.repo
--2016-10-01 09:44:02--Http://mirrors.163.com/.help/CentOS7-Base-163.repo
Resolving host mirrors.163.com (mirrors.163.com) ... 123.58.173.186, 123.58.173.185
Connecting mirrors.163.com (mirrors.163.com) |123.58.173.186|:80 ... is connected.
HTTP request issued, waiting for response ... OK
Length: 1572 (1.5K) [Application/octet-stream]
Saving to: "Centos7-base-163.repo"


100%[========================================================================================================== ===========================================>] 1,572--.-k/s spents 0s


2016-10-01 09:44:02 (190 MB/s)-Saved "Centos7-base-163.repo" [1572/1572])


You can see that 163 of the Yum source has been downloaded.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.