搭建yum
Centos8
先添加Centos6.7.8的光盘
搭建yum可用使用http,ftp,htps
12:20:02 root@Centos8[ ~]#dnf repolist //查看yum的所有的库
CentOS-8 - AppStream 1.5 kB/s | 4.3 kB 00:02
CentOS-8 - Base 1.4 kB/s | 3.9 kB 00:02
CentOS-8 - Extras 601 B/s | 1.5 kB 00:02
repo id repo name status
AppStream //库名称 CentOS-8 - AppStream 5,089 //包的数量
BaseOS CentOS-8 - Base 2,843
extras CentOS-8 - Extras
下载httpd软件
yum不支持并行
[12:22:53 root@Centos8[ ~]#dnf install -y httpd
禁用sellinux
[12:41:48 root@Centos8[ ~]#setenforce 0 //临时禁用
[19:52:26 root@Centos8[ ~]#vim /etc/selinux/config
[19:55:19 root@Centos8[ ~]#
禁用防火墙
[12:32:56 root@Centos8[ ~]#systemctl enable --now httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[12:33:18 root@Centos8[ ~]#systemctl disable --now firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[12:36:43 root@Centos8[ ~]#
[19:56:17 root@Centos8[ ~]#iptables -F //强制关闭防火墙
[19:56:23 root@Centos8[ ~]#iptables -vnL //查看
创建文件夹
[12:43:53 root@Centos8[ html]#mkdir centos/{6,7}/os/x86_64 -pv //创建centos6,7的文件夹-pv创建多个文件并显示过程
[12:47:30 root@Centos8[ html]#mkdir centos/8/ -pv
启动httpd
[19:58:15 root@Centos8[ ~]#systemctl enable --now httpd //启动命令
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[20:00:18 root@Centos8[ ~]#
挂载光盘
[12:51:59 root@Centos8[ ~]# mount /dev/sr0 /var/www/html/centos/6/os/x86_64/
mount: /var/www/html/centos/6/os/x86_64: WARNING: device write-protected, mounted read-only.
[12:52:28 root@Centos8[ ~]# mount /dev/sr2 /var/www/html/centos/7/os/x86_64/
mount: /var/www/html/centos/7/os/x86_64: WARNING: device write-protected, mounted read-only.
[12:53:48 root@Centos8[ ~]# mount /dev/sr1 /var/www/html/centos/8