关闭firewall
1 2 3 |
systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 |
yum
使用国内镜像站点
阿里云镜像站点:https://opsx.alibaba.com/mirror
- 第一步、下载新的CentOS-Base.repo 到/etc/yum.repos.d/
1 2 3 4 5 6 7 8 |
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 |
- 第二步、生成缓存
1 |
yum makecache |
- 第三部、安装epel
1 |
yum install -y epel-release |
常用命令
安装: yum install -y wget
卸载: yum remove wget
搜索: yum search wget
列表: yum list
查看版本: yum list wget –showduplicates | sort -r
指定版本: yum install wget-1.14