1. 程式人生 > >Centos6/7更新Yum源-網易yum源/阿里yum源

Centos6/7更新Yum源-網易yum源/阿里yum源

Yum源倉庫

下載其他更快的yum源

中科大的yum源:

wget http://centos.ustc.edu.cn/CentOS-Base.repo

163的yum源:

wget http://mirrors.163.com/.help/CentOS-Base-163.repo

http://mirrors.163.com/.help/CentOS6-Base-163.repo

sohu的yum源

wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

阿里的yum源

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo

http://mirrors.aliyun.com/repo/Centos-6.repo

或者

curl -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

 

 

一、示例更換阿里雲yum源

阿里雲 CentOS

1、備份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下載新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

或者

curl -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

或者

curl -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

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、之後執行yum makecache生成快取

 

 

二、示例配置網易163的yum源

1. 下載repo檔案

    下載地址:http://mirrors.163.com/.help/CentOS6-Base-163.repo

2. 備份並替換系統的repo檔案

[[email protected] ~]# cd /etc/yum.repos.d/

[[email protected] ~]# mv CentOS-Base.repo CentOS-Base.repo.bak

[[email protected] ~]# mv /root/CentOS6-Base-163.repo CentOS-Base.repo

3. 執行yum源更新

[[email protected] ~]# yum clean all

[[email protected] ~]# yum makecache

[[email protected] ~]# yum update

4. 到此已結束,用yum安裝一下檔案,看是否OK

[[email protected] ~]# yum install vim*

5. 安裝centos常用的軟體包及工具

    常見壓縮工具 zip unzip bzip2

[[email protected] ~]# yum -y install unzip zip bzip2 bzip2-devel 

  gcc gcc++編譯器

[[email protected] ~]# yum install gcc gcc-c++ -y

  cmake編譯器

[[email protected] ~]# yum install cmake make -y

  圖片資源

[[email protected] ~]# yum -y install gd libjpeg libjpeg-devel libpng libpng-devel freetype-devel 

  其它常用資源包工具

[[email protected] ~]# yum -y install autoconf bison automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*