@MrXiao
2018-08-31T09:34:21.000000Z
字数 1193
阅读 1205
Linux
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
Centos5
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
yum clean all
yum makecache
yum [options] [command] [package ...]
参数:
options:可选,包括-h(帮助),-y(安装过程中提示全部选yes),-q(不显示安装过程)
command:要进行的操作
package:操作的对象
1)列出所有可更新的软件清单命令:yum check-update
2)更新所有软件命令:yum update
3)仅安装指定的软件命令:yum install
4)仅更新指定的软件命令:yum update
5)列出所有可安裝的软件清单命令:yum list,list后面可以接各种参数,详情请man yum
6)删除软件包命令:yum remove
7)查找软件包 命令:yum search
8)清除缓存命令:
yum clean packages: 清除缓存目录下的软件包
yum clean headers: 清除缓存目录下的 headers
yum clean oldheaders: 清除缓存目录下旧的 headers
yum clean, yum clean all (= yum clean packages; yum clean oldheaders):清除缓存目录下的软件包及旧的headers