码迷,mamicode.com
首页 > Web开发 > 详细

基于http的yum源

时间:2019-08-03 20:04:31      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:etc   centos6   from   实验   star   version   alt   block   www   

实验:基于http的yum源

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

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

技术图片

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

[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/

六、网页访问测试

技术图片

七、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]:

基于http的yum源

标签:etc   centos6   from   实验   star   version   alt   block   www   

原文地址:https://blog.51cto.com/14012942/2426285

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!