本地源配置
vim /etc/yum.rpos.d/*.repo //yum源的配置文件 |
[*] //此处*为yum配置文件名 |
name=name //yum源的名字(可随便填) |
baseurl=file:///iso //本地光盘挂载路径 |
enabled=1 //开启本地更新模式(默认开启) |
gpgcheck=0 //关闭gpg验证 |
网络源配置
国内网络源 |
网易源: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://centos.ustc.edu.cn/CentOS-Base.repo |
搜狐源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.sohu.com/help/CentOS-Base-sohu.repo |
阿里源:weget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo |
腾讯源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo |
华为源:wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo |
yum clean all //清除yum源缓存 |
yum makecache //重建缓存 |
yum安装命令
yum install -y 软件包
yum卸载命令
yum remove -y 软件包
查看软件包命令
yum list 软件包