Mirror domestic use
If your system centos yum source of the problem, how to fix?
Method 1: Use Domestic Ali cloud images
(1) all of the following sources /etc/yum.repos.d/ to delete the
(2) Download Mirror
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
Note that if no wget installed, you can manually downloaded from the following URL, then upload it to install linux: http: //www.rpmfind.net/linux/rpm2html/search.php query = wget ?
(3) Run, regenerates the cache
Clean All yum
yum makecache
way: mirroring the official website
(1) all of the following sources /etc/yum.repos.d/ to delete the
(2) Run the following commands, regenerated image
After executing this command //
RPM -Uvh --force http://mirror.centos.org/centos-7/7/os/x86_64/Packages/centos-release-7-4.1708.el7.centos.x86_64.rpm
( 3) Check the following /etc/yum.repos.d/ directory, you will find a mirror has been installed:
-rw-r-r--. 1 root root 1664 23:53. 8 the CentOS-Base.repo dated 30
-rw-R & lt-r--.. 1. 8 dated 1309 the root the root-CR.repo the CentOS 23:53 30
-rw -r-r--. 1 root root 649. 8 the CentOS-Debuginfo.repo 23:53 dated 30
-rw-R & lt-r--.. 1. 8 the root 314 dated the root-fasttrack.repo the CentOS 23:53 30
-rw-R & lt -r--. 1 root root 630. 8 the CentOS-Media.repo 23:53 dated 30
-rw-R & lt-r--.. 1. 8 dated 1331 the root the root-Sources.repo the CentOS 23:53 30
-rw-R & lt-R & lt -. 1 root root 3830 dated. 8 the CentOS-Vault.repo 23:53 30
(. 4) generating the cache
Clean All yum
yum makecache
if necessary, execute yum update to update the current system to the new installation package
Manually download command, example:
# Vim mounting assembly
yum install -y vim
# Vim unload components
yum remove vim
attention to the second example, if you can not access foreign official website, or visit the slower times out, it will cause the installation to fail, which can be used when the first way to install