Centos8搭建本地yum源

搭建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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值