Reinstall Yum Base-Repo Source to CentOS

How can I fix if my own CentOS’s system YUM source?

#### way 1: Using domestic Ali Cloud Mirror

(1) Remove all the sources below /etc/yum.repos.d/ below.

(2) Download the mirror

“ “ # Centos 5wget -o /etc/yum.repos.d/centos-base.repo http://mirrors.aliyun.com/repo/centos-5.repo# centos 6wget -o / etc / yum. Repos.d / centos-base.repo http://mirrors.aliyun.com/repo/centos-6.repo# centos 7wget -o /etc/yum.repos.d/centos-base.repo http: // mirro .aliyun.com / repo / centos-7.repo““

Note If you are not installed, you can download it from the following URL, then upload to Linux installation:

http://www.rpmfind.net/linux/rpm2html/search.php?query=wget

(3) Execute the command, regenerate Cache

“ “ yum clean allyum makecacche““

#### way 2: Mirroring using the official website

(1) Remove all the sources below /etc/yum.repos.d/ below.

(2) Execute the following command, regenerate the mirror

“ “ // RPM -UVH –force http://mirror.centos.org/centos-7/7/Centos.org/centos-7-4.1708.el7.centos. X86_64.rpm“` (3) View /etc/yum.repos.d/ The following directory will find that the image has been installed:

“ “ -rw-r – r -. 1 root root 1664 August 30 23:53 Centos-base.repo-rw-r – r – r-. 1 root root 1309 August 30 23:53 Centos -Cr.repo-rw-r – r – r (1 ROOT ROOT 649) August 30 23:53 Centos-debuginfo.repo-rw-r – r —. 1 root root314 August 30 23:53 Centos-fasttrack .repo-rw-r – r -. 1 root root630 August 30:53 Centos-media.repo-rw-r – r -. 1 root root 1331 August 30 23:53 Centos-Sources. REPO-RW-R – R – ROOT ROOT 3830 August 30:53 Centos-Vault.repo““

(4) Generate a cache

“ “ yum clean allyum makecacche““

If necessary, you can perform Yum Update update the current system installation package for new

Manually download command, example:

“ “ # Install VIM Components Yum Install -y Vim # Uninstall Vim Components Yum Remove Vim“`

Note the second example, if you cannot access the foreign official website, or if the access is slower, it will cause the installation to fail, this time you can use the first way to install.

What is the problem can scan the code to pay attention to the WeChat public number: I am a macerist (Woshigcs), in the background message consultation. Technical debt cannot be owed, healthy debts can not be owed, the road to seek, and doing the king.

Related Posts