yum源更换与更新系统

2016/10/09 linux

#Centos更换yum源

步骤如下:

##备份原始源

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

##下载相应的源 常用的如阿里,163的yum

163源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

阿里源

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

##生成缓存

yum clean all (清除所有的缓存)
yum makecache (将服务器上的软件包信息在本地缓存,以提高 搜索安装软件的速度。)

##更新系统

yum -y update (更新所有的rpm包,升级所有包同时也升级软件和系统内核)
yum -y upgrade (只升级所有包,不升级软件和系统内核)

Search

    Table of Contents