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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zenmin2015/article/details/86415183

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文件

[root@localhost ~]# cd /etc/yum.repos.d/

[root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo.bak

[root@localhost ~]# mv /root/CentOS6-Base-163.repo CentOS-Base.repo

3. 执行yum源更新

[root@localhost ~]# yum clean all

[root@localhost ~]# yum makecache

[root@localhost ~]# yum update

4. 到此已结束,用yum安装一下文件,看是否OK

[root@localhost ~]# yum install vim*

5. 安装centos常用的软件包及工具

    常见压缩工具 zip unzip bzip2

[root@localhost ~]# yum -y install unzip zip bzip2 bzip2-devel 

  gcc gcc++编译器

[root@localhost ~]# yum install gcc gcc-c++ -y

  cmake编译器

[root@localhost ~]# yum install cmake make -y

  图片资源

[root@localhost ~]# yum -y install gd libjpeg libjpeg-devel libpng libpng-devel freetype-devel 

  其它常用资源包工具

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

猜你喜欢

转载自blog.csdn.net/zenmin2015/article/details/86415183