实验:基于http的yum源
selinux,firewalld已经关闭‘,系统为CentOS7
一、VMware插入两张光盘,6和7
二、手动触发系统的扫描机制
[[email protected] html]# echo ‘ - - - ‘ > /sys/class/scsi_host/host0/scan
[[email protected] html]# echo ‘ - - - ‘ > /sys/class/scsi_host/host1/scan
[[email protected] html]# echo ‘ - - - ‘ > /sys/class/scsi_host/host2/scan
[[email protected] html]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 200G 0 disk
├─sda1 8:1 0 1G 0 part /boot
├─sda2 8:2 0 100G 0 part /
├─sda3 8:3 0 50G 0 part /data
├─sda4 8:4 0 1K 0 part
└─sda5 8:5 0 4G 0 part
└─centos-swap 253:0 0 4G 0 lvm [SWAP]
sr0 11:0 1 10G 0 rom /var/www/html/centos7/os/x86_64
sr1 11:1 1 3.7G 0 rom
三、yum安装httpd并启动
[[email protected] html]# yum install httpd -y
[[email protected] html]# systemctl start httpd
四、/var/www/html下面创建目录结构
[[email protected] html]# cd /var/www/html/
[[email protected] html]# mkdir centos{6,7}/os/x86_64 -p
五、分别挂载两张光盘到对应目录
[[email protected] html]# mount /dev/sr0 /var/www/html/centos7/os/x86_64/
[[email protected] html]# mount /dev/sr1 /var/www/html/centos6/os/x86_64/
六、网页访问测试
七、CentOS6测试
7.1、备份原来的repo文件
[[email protected] ~]# mkdir /etc/yum.repos.d/backup
[[email protected] ~]# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup
[[email protected] ~]# cat /etc/yum.repos.d/base.repo
[test]
name=test
baseurl=http://192.168.38.128/centos6/os/x86_64/
enabled=1
gpgcheck=0
7.2、装个包弯弯,没问题
[[email protected] ~]# yum install samba
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package samba.x86_64 0:3.6.23-51.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================
Package Arch Version Repository Size
======================================================================================================================
Installing:
samba x86_64 3.6.23-51.el6 test 5.1 M
Transaction Summary
======================================================================================================================
Install 1 Package(s)
Total download size: 5.1 M
Installed size: 18 M
Is this ok [y/N]:
原文地址:https://blog.51cto.com/14012942/2426285
时间: 2024-10-05 23:25:27