Share a few CentOS7 yum sources,
Every technology will go through a variety of small white time, a variety of predicament, below to share their experience:
The situation is as follows, I accidentally installed a minimum of CentOS 7, (that is, no CRT upload download tool, nor Wget), but also remote management, suddenly want to remotely install some software, a variety of crazy, want to update the Yum source, incredibly no good way to download Ali and NetEase's Yum source, Open will face a more embarrassing problem, no branch, no way to use CRP copy paste, so this article will give you a CRT can be used to enter the Yum.
First of all: CentOS 7 adds a new module (loaded plugin: fastestmirror), which automatically identifies the nearest Yum source, but is not as fast as the Yum source being written.
The steps are as follows:
1: Back up your own Yum source
Cp/etc/yum.repos.d/centos-base.repo/etc/yum.repos.d/centos-base.repo.bk
2: Empty the/etc/yum.repos.d/centos-base.repo and wait for the new Yum source input.
echo "" >/etc/yum.repos.d/centos-base.repo
(Of course I am just a personal habit, can also be deleted after the reconstruction, or the VI editor to delete the command means that
Append a space to the file and overwrite the previous file)
3: Open the file with the VI editor/etc/yum.repos.d/centos-base.repo
Vi/etc/yum.repos.d/centos-base.repo
4: Paste in the following file (Ali Yum)
# Centos-base.repo
#
# The Mirror system uses the connecting IP address of the client and the
# Update status of each mirror to pick mirrors that is updated to and
# Geographically close to the client. You should the use of this for CentOS updates
# Unless you is manually picking other mirrors.
#
# If The mirrorlist= does not work for you, as a fall back to you can try the
# remarked out Baseurl= line instead.
#
#
[Base]
name=centos-$releasever-base-mirrors.aliyun.com
Failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=os
Gpgcheck=1
Gpgkey=http://mirrors.aliyun.com/centos/rpm-gpg-key-centos-7
#released Updates
[Updates]
name=centos-$releasever-updates-mirrors.aliyun.com
Failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=updates
Gpgcheck=1
Gpgkey=http://mirrors.aliyun.com/centos/rpm-gpg-key-centos-7
#additional packages that could be useful
[Extras]
name=centos-$releasever-extras-mirrors.aliyun.com
Failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=extras
Gpgcheck=1
Gpgkey=http://mirrors.aliyun.com/centos/rpm-gpg-key-centos-7
#additional packages that extend functionality of existing packages
[Centosplus]
name=centos-$releasever-plus-mirrors.aliyun.com
Failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=centosplus
Gpgcheck=1
Enabled=0
Gpgkey=http://mirrors.aliyun.com/centos/rpm-gpg-key-centos-7
#contrib-packages by Centos Users
[Contrib]
name=centos-$releasever-contrib-mirrors.aliyun.com
Failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
#mirrorlist =http://mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=contrib
Gpgcheck=1
Enabled=0
Gpgkey=http://mirrors.aliyun.com/centos/rpm-gpg-key-centos-7
5. ": Wq" after exiting, using Yum Makecache to generate the cache, it is possible to fail, because it is possible to configure the network DNS for Google's 8.8.8.8, the address of the domestic individual website parsing is not perfect, so will be prompted not to find the host.
Can edit/etc/resolv.conf add a "nameserver 114.114.114.114", don't ask why this DNS, because good remember.
6.yum Makecache, then remember yum install wget, and then want to change other sources can be used directly with wget. No longer an example.
BUG: In CentOS 7, modify the/etc/resolv.conf, and can not permanently modify the DNS, but may be written in the network card, but modify the network card configuration file needs to restart the network card to take effect, written in the/etc/resolv.conf will immediately take effect, in the study, the details see Follow-up blog post.
Remark: Please leave a message if you have any questions, please specify the source if you want to reprint.
This article is from the "Mu bai fringe" blog, please be sure to keep this source http://mubsky.blog.51cto.com/3081455/1703760
CentOS 7 Yum Source