Solve CentOS6.9 use yum to install gccError: Cannot find a valid baseurl for r

Source: Internet
Author: User

Solve CentOS6.9 use yum to install gccError: Cannot find a valid baseurl for r

Enter yum-y install gcc and the error "cocould not retrieve into list http://mirrorlist.centos.org..." is reported ....

Error: Cannot find a valid baseurl for repo: base.

The error is that the network yum source cannot be connected. We can download it from the CD.

Solution:

1. Hanging on a CD:

Mount/dev/cdrom/mnt/cdrom

2. Enter the file/etc/yum. repos. d/to make the network yum source invalid, that is, the source files except the CentOS-Media.repo in yum. repos. d are invalid:

Method 1: Modify the CentOS-Base.repo file name to CentOS-Base.repo.bak (change. repo to other will be invalid );

Method 2: change enable = 1 in the network yum source file to = 0.

3. Modify the disc yum source file CentOS-Media.repo:

Baseurl = file: // media/CentOS is changed to file: // mnt/cdrom, that is, to the disk Mount address/mnt/cdrom, comment out other non-existent file addresses; and enable is set to 1.

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.