实验:基于http的yum源
实验:基于http的yum源
selinux,firewalld已经关闭‘,系统为CentOS7
repodata所在的目录就是yum源
下面介绍了如何把本地光盘通过httpd服务器变成yum源;多个源写到一个文件;把现有的rpm包创建成yum仓库;
一、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]:
八、多个源写到一个文件
# CentOS7加入yum.txt文件,包含本地源和阿里源
[root@centos7 ~]# cat /var/www/html/yum.txt
http://192.168.38.128/centos6/os/x86_64/
https://mirrors.aliyun.com/centos/6/os/x86_64/
# CentOS6修改repo文件
[root@qqq ~]# cat /etc/yum.repos.d/base.repo
[test]
name=test
#baseurl=http://192.168.38.128/centos6/os/x86_64/
mirrorlist=http://192.168.38.128/yum.txt
enabled=1
gpgcheck=0
九、撞个包玩玩
[root@qqq ~]# yum install vsftpd
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Determining fastest mirrors
* test: 192.168.38.128
test | 4.0 kB 00:00
test/primary_db | 4.7 MB 00:00
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:2.2.2-24.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================
Package Arch Version Repository Size
======================================================================================================================
Installing:
vsftpd x86_64 2.2.2-24.el6 test 156 k
Transaction Summary
======================================================================================================================
Install 1 Package(s)
Total download size: 156 k
Installed size: 340 k
Is this ok [y/N]:
十、手动创建yum的repo源
10.1、传输这几个rpm文件
[root@centos7 html]# mkdir dnf
[root@centos7 html]# cd dnf
[root@centos7 dnf]# rz
z waiting to receive.**B0100000023be50
[root@centos7 dnf]# ls
dnf-0.6.4-2.sdl7.noarch.rpm libcomps-0.1.8-3.el7.x86_64.rpm python-dnf-0.6.4-2.sdl7.noarch.rpm
dnf-conf-0.6.4-2.sdl7.noarch.rpm python2-libcomps-0.1.8-3.el7.x86_64.rpm
10.2、创建repo
[root@centos7 dnf]# createrepo .
Spawning worker 0 with 5 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@centos7 dnf]# ls
dnf-0.6.4-2.sdl7.noarch.rpm libcomps-0.1.8-3.el7.x86_64.rpm python-dnf-0.6.4-2.sdl7.noarch.rpm
dnf-conf-0.6.4-2.sdl7.noarch.rpm python2-libcomps-0.1.8-3.el7.x86_64.rpm repodata
10.3、CentOS7配置repo配置文件
[root@centos7 dnf]# cat /etc/yum.repos.d/dnf.repo
[dnf]
name=dnf
baseurl=http://192.168.38.128/dnf/
enabled=1
gpgcheck=0
10.4、yum repolist
[root@centos7 dnf]# yum repolist dnf
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.lzu.edu.cn
* extras: mirror.jdcloud.com
* updates: mirror.lzu.edu.cn
repo id repo name status
dnf dnf 5
10.5 安装个dnf玩玩
# 可以yum install dnf
# 也可以如下
[root@centos7 dnf]# yum install *.rpm
# 此处给的包报错了,放弃这种方法,使用yum
[root@centos7 dnf]# yum install dnf
实验:基于http的yum源的更多相关文章
- centos6.4搭建基于ftp的yum源让本地局域网服务器使用
1. 挂载centos6.4 DVD镜像[root@centos64 ~]# mount /dev/cdrom /mnt 2. 安装vsftp软件,启动vsftpd服务,拷贝centos6.4 DVD ...
- 基于光盘配置yum源
#开启自动挂载服务 systemctl start autofs #设置开机自动挂载 systemctl enable autofs #光盘自动挂载路径/misc/cd “包含repoda ...
- centos6环境创建局域网http方式的yum源
环境: yum服务器:centos 6.3 :192.168.8.20 yum源客户端:centos6.5 使用的主要rpm包来自centos6.5光盘 yum源服务器端配置: 1. 首先需要检查一下 ...
- 【Linux】YUM源搭建
YUM是什么? YUM是什么 基于rpm但更胜于rpm的软件管理工具: YUM有服务端和客户端: 如果服务端和客户端在同一台机器,这是本地YUM: 如果服务端和客户端不在同一台机器,这是网络YUM. ...
- CentOS6.5创建yum源
昨天给布置个新的需求,做一个Yum仓库,要求是HTTP式的,在某个服务器上搭建个Yum仓库,能让其它的机器有了这个机器的.repo仓库文件后就可以从本地下载安装软件,以前都是下载后直接yum inst ...
- 创建本地yum源仓库
更新本地yum源 yum仓库服务端配置如下 : 1. 创建yum仓库目录 mkdir -p /data/yum_data/ cd /data/yum_data/ #可以上传rpm包到此目录,此目录下面 ...
- Hadoop生态圈-基于yum源的方式部署Cloudera Manager5.15.1
Hadoop生态圈-基于yum源的方式部署Cloudera Manager5.15.1 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 我之前分享过关于离线方式部署Cloudera ...
- 基于本地iso 搭建的本地yum源 安装部署openldap
1,yum openldap-servers,openldap-clients 基于iso-cd1搭建的本地yum源(具体搭建参看ruige的repo本地快速搭建,在右边 找找看中输入repo key ...
- 基于FTP服务器搭建yum源
本例以CentOS6.8为试验对象,来搭建基于FTP服务器的yum源. 一.配置本地yum源 1.创建挂载目录/yum mkdir /yum 2.挂载镜像 mount -o loop CentOS- ...
随机推荐
- HTTP中get和post
HTTP中get和post的区别 GET - 从指定的资源请求数据. POST - 向指定的资源提交要被处理的数据 GET POST 后退/刷新 无害的 数据会被重新提交 书签 可收藏为书签 不可收藏 ...
- 【Redis】Could not get a resource from the pool 实乃集群配置问题
先说些题外话~自上次确诊为鼻窦炎+过敏性鼻炎到现在已经一个月了,最初那会,从下午到晚上头疼难忍.大概是积劳成疾,以前流鼻涕.打喷嚏的时候从来没有注意过,结果病根一下爆发. 关键在于锁定问题,开始治疗一 ...
- 扩展阿里p3c实现自定义代码规范检查
前段时间fastjson报出了漏洞,只要打开setAutoType特性就会存在风险,自己测试环境的一个项目被揪出来了-_-!.虽然改动很小,但就是觉得憋屈.fastjson还是挺好的,想着禁用的话太 ...
- <Machine Learning - 李宏毅> 学习笔记
<Machine Learning - 李宏毅> 学习笔记 b站视频地址:李宏毅2019国语 第一章 机器学习介绍 Hand crafted rules Machine learning ...
- JVM - 复习
内存模型图 程序计数器(PC) 程序计数器的特点 PC是一小块内存空间,用于记录当前线程执行的字节码指令的地址.如果执行的是本地方法(native),PC里此时显示Undefined 优点: 控制程序 ...
- GC 知识点补充——CMS
之前已经讲过了不少有关 GC 的内容,今天准备将之前没有细讲的部分进行补充,首先要提到的就是垃圾收集器. 基础的回收方式有三种:清除.压缩.复制,衍生出来的垃圾收集器有: Serial 收集器 新生代 ...
- Java中Object类hashCode的底层实现
Java中Object类hashCode的底层实现 openjdk\jdk\src\share\native\java\lang\Object.c 42 static JNINativeMethod ...
- 元组/字典/集合内置方法+简单哈希表(day07整理)
目录 二十三.元组内置方法 二十四.字典数据类型 二十五 集合内置方法 二十五.数据类型总结 二十六.深浅拷贝 补充:散列表(哈希表) 二十三.元组内置方法 什么是元组:只可取,不可更改的列表 作用: ...
- Android Studio配置Socks5代理后Gradle运行不正常
第一次在Mac上运行Android Studio,遇到了一系列问题,其中一个代理问题搞得我是不知所措,在此记录. 如果你遇到了如下图的问题,那么恭喜你你可能已经找到了解决方案也就是本文: 一般,我们为 ...
- Vue 实现前进刷新,后退不刷新的效果 玩转vue-router里的meta
Vue 实现前进刷新,后退不刷新的效果 玩转vue-router里的meta. 需求一: 在一个列表页中,第一次进入的时候,请求获取数据. 点击某个列表项,跳到详情页,再从详情页后退回到列表页时,不刷 ...