基于http的yum源

实验:基于http的yum源

selinux,firewalld已经关闭‘,系统为CentOS7

一、VMware插入两张光盘,6和7

基于http的yum源

二、手动触发系统的扫描机制

[root@centos7 html]# echo ' - - - ' > /sys/class/scsi_host/host0/scan
[root@centos7 html]# echo ' - - - ' > /sys/class/scsi_host/host1/scan
[root@centos7 html]# echo ' - - - ' > /sys/class/scsi_host/host2/scan 
[root@centos7 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并启动

[root@centos7 html]# yum install httpd -y
[root@centos7 html]# systemctl start httpd

四、/var/www/html下面创建目录结构

[root@centos7 html]# cd /var/www/html/
[root@centos7 html]# mkdir centos{6,7}/os/x86_64 -p

五、分别挂载两张光盘到对应目录

[root@centos7 html]# mount /dev/sr0 /var/www/html/centos7/os/x86_64/
[root@centos7 html]# mount /dev/sr1 /var/www/html/centos6/os/x86_64/

六、网页访问测试

基于http的yum源

七、CentOS6测试

7.1、备份原来的repo文件

[root@qqq ~]# mkdir /etc/yum.repos.d/backup
[root@qqq ~]# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup
[root@qqq ~]# 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、装个包弯弯,没问题

[root@qqq ~]# 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]:

猜你喜欢

转载自blog.51cto.com/14012942/2426285