yum基础命令操作
基础命令操作
命令 | 效果 |
---|---|
yum install -y | 安装 |
yum makecache | 更新yum缓存 |
yum list installed | grep xxx | 查看已经安装软件 |
yum -y update xxx | 更新软件 配置和系统设置都会被修改 |
yum -y upgrade xxx | 更新软件 配置和系统设置都不会被修改 |
yum remove xxx xxx xxx | 卸载 |
make clean all | 清除所有的yum缓存 |
yum search xxx | 查找软件 |
yum info xxx | 查看软件的信息 |
yum源的更新
-
备份
mv /etc/yum.repos.d/Centos-Base.repo /etc/yum.repos.d/Centos-Base.repo.bak
-
更新阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- -O 重新命名,显示下载信息;
- -o 不显示下载信息,下载信息保存在第一个参数文件中;
-
更新yum缓存
yum makecache
wget资源下载 有些资源需要加参数 -no-check-certificate