环境准备
配置本地yum
在虚拟机上挂载CentOS镜像文件
1
mount -t iso9660 /dev/sr0 /opt/centos
vi /etc/yum.repos.d/local.repo
1
2
3
4
5[local]
name=local
baseurl=file:///opt/centos
enabled=1
gpgcheck=0更新
1
2
3
4
5
6
7[root@kangvcar ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: local
Cleaning up everything
Cleaning up list of fastest mirrors
[root@kangvcar ~]# yum makecache //把yum源缓存到本地,加快软件的搜索好安装速度
[root@kangvcar ~]# yum list //列出包
配置阿里云yum
1 | cd /etc/yum.repos.d/ |
如果wget命令不生效,说明还没有安装wget工具,输入yum -y install wget 回车进行安装。1
2
3
4
5mv CentOs-Base.repo CentOs-Base.repo.bak
mv Centos-7.repo CentOs-Base.repo
yum clean all
yum makecache
yum update
安装必须包
1 | yum -y install gcc gcc-c++ autoconf pcre pcre-devel make automake |
关闭selinux
查看selinux状态1
getenforce
临时关闭selinux1
setenforce 0
创建一些目录(非必须)
1 | cd opt |