我要评分
获取效率
正确性
完整性
易理解

Configuring the Yum Source

  1. Use PuTTY to log in to the server as the root user.
  2. Configure the Yum source.
    1. Open the CentOS-Base.repo file.
      vi /etc/yum.repos.d/CentOS-Base.repo
    2. Press i to enter the insert mode. Delete the existing content and add the following content:
      [BaseOS]
      name=CentOS-$releasever - Base
      mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
      #baseurl=http://mirror.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/
      gpgcheck=1
      enabled=1
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Clear the cache.
    yum clean all
  4. Refresh the cache.
    yum makecache