yum仓库的创建
这篇博客是yum仓库的配置过程,如果是yum客户端配置请参考 http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_linux_002.html
1 环境介绍
这里我有2个环境,一个centos7,一个centos6环境, 打算使用centos6作为yum仓库,然后使用centos7作为客户端。
2 环境准备
我们知道配置yum的时候我们需要指定baseurl的,只有三种协议支持的,分别是http,ftp,file。这里我们我们选择ftp方式,在centos6机器上安装ftp软件并提供服务。
2.1 安装ftp服务端软件
[root@centos6 ~]# yum install vsftpd -y #安装vsftpd软件,没有yum配置的话,可以使用rpm安装
[root@centos6 ~]# chkconfig vsftpd on #开机启动
[root@centos6 ~]# service vsftpd start #启动ftp服务
Starting vsftpd for vsftpd: [ OK ]
2.2 禁用selinux
[root@centos6 ~]# getenforce #查看当前的selinux状态
Enforcing
[root@centos6 ~]# setenforce 0 #禁用
[root@centos6 ~]# sed -i 's@SELINUX=enforcing@SELINUX=permissive@' /etc/sysconfig/selinux #修改配置文件
2.3 关闭防火墙
[root@centos6 ~]# service iptables status #查看当前的防火墙设置
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
ACCEPT all -- 0.0.0.0/ 0.0.0.0/ state RELATED,ESTABLISHED
ACCEPT icmp -- 0.0.0.0/ 0.0.0.0/
ACCEPT all -- 0.0.0.0/ 0.0.0.0/
ACCEPT tcp -- 0.0.0.0/ 0.0.0.0/ state NEW tcp dpt:
REJECT all -- 0.0.0.0/ 0.0.0.0/ reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT)
num target prot opt source destination
REJECT all -- 0.0.0.0/ 0.0.0.0/ reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT)
num target prot opt source destination [root@centos6 ~]# service iptables stop #关闭防火墙
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@centos6 ~]# chkconfig iptables off #开机不启动ftp
2 提供yum仓库文件
2.1 把centos7的包复制到centos6的机器上
[root@centos6 os]# mkdir -pv /var/ftp/pub/yum/centos/7/os/x86_64 #创建对应目录, 这个目录是仿照aliyun的那个目录组织的,清晰,这样客户端可以使用$basearch,$releasevel变量
[root@centos6 os]# mount /dev/sr1 -r /var/ftp/pub/yum/centos//os/x86_64 #我这里就直接挂载个光盘,建议使用硬盘文件,而不是光盘
[root@centos6 os]# ll /var/ftp/pub/yum/centos//os/x86_64
3 测试ftp服务是否正常
由于我们的centos7没有ftp的软件,所以这里使用wget测试下
[root@centos7 yum.repos.d]$wget ftp://172.18.1.159/ #下载下ftp页面
[root@centos7 yum.repos.d]$ cat index.html |grep pub #查看是否有pub,如果有那就是ftp服务是正常的了
Nov : Directory <a href="ftp://172.18.1.159:21/pub/">pub/</a>
测试发现,我们的centos6提供的ftp一切正常, 可以供centos7使用的。
4 centos7配置测试yum
4.1 配置yum配置文件
[root@centos7 yum.repos.d]$ vim network.repo #编写repo文件
[root@centos7 yum.repos.d]$ cat network.repo
[network]
name=network
baseurl=ftp://172.18.1.159/pub/yum/centos/$releasever/os/$basearch/
gpgcheck=
4.2测试yum配置
[root@centos7 yum.repos.d]$ yum clean all #清空缓存
Loaded plugins: fastestmirror, langpacks
Cleaning repos: network
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors [root@centos7 yum.repos.d]$ yum -y install lftp #测试安装软件
5 如何给特定的rpm包生成仓库
[root@centos6 test]# yum install createrepo -y #创建仓库需要createrepo命令,有createrepo这个包提供
#copy一些rpm包到test目录中。
[root@centos6 test]# createrepo . #在rpm文件里面执行,就可以创建一个仓库
剩下的工作就是把这个目录作为baseurl提供出去了。
yum仓库的创建的更多相关文章
- 命令用法习题,yum仓库的创建 chapter02 - 03 作业
1. 分别用cat \tac\nl三个命令查看文件/etc/ssh/sshd_config文件中的内容,并用自己的话总计出这三个文档操作命令的不同之处? [root@localhost /]# ca ...
- 【程序包管理】本地yum仓库的创建
一.yum优势 yum( Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器. 基於RPM包管理,能够从指定的服务器 ...
- 在centos6.5下yum仓库的创建
第一步:打开虚拟机,装入光盘镜像,选择为已连接 第二步: df -h mount umount /dev/sr0 mkdir /centos mount /dev/sr0 /centos mkdir ...
- 创建自己的YUM仓库
1. 首先,假定我们应用的名字叫helloworld(可以参考简单 RPM 包制作来创建两个版本helloworld安装RPM包,helloworld-1.0.0-1.el6.x86_64.rpm和h ...
- centos创建本地yum仓库
怎样发布自己软件的安装和更新YUM源 在创建之前,我们先了解些相关的内容: yum仓库可以支持三种途径提供给yum在安装的时候下载rpm包 第一种: ftp服务 ftp:// 第二种: http ...
- 创建yum仓库
第1章 服务端)创建yum仓库目录 命令:(创建)mkdir -p /application/yum/centos6.6/x86_64/ 命令:(切换)cd /application/yum/cent ...
- repodata创建本地YUM仓库
参考一createrepo是linux下的创建仓库的软件包.create是创建的意思,repo是repository的缩写,是仓库的意思. yum(Yellow dog Updater,Modifie ...
- 创建私有yum仓库
创建私有yum仓库
- Linux系统管理第二次作业 目录和文件管理 rpm安装 创建yum仓库
chapter02 - 03 作业 1.分别用cat \tac\nl三个命令查看文件/etc/ssh/sshd_config文件中的内容,并用自己的话总计出这三个文档操作命令的不同之处? [ ...
随机推荐
- 关于各种工具输入参数中"-"和"--"
关于各种工具输入参数中"-"和"--" 写个随笔记录下来 一直搞不懂,为啥在使用很多工具的时候,他的参数要加的"-"数量不一样呢? 如果输入 ...
- 超时导致的Galera节点加入集群失败
需求:为galera集群添加新的节点. 初始化新的节点,加入的时候一直报错,加入失败,报错日志如下 WSREP_SST: [ERROR] Removing /var/lib/mysql//.sst/x ...
- Oracle事务与锁 知识点摘记
事务:事务用于保证数据的一致性,它由一组相关的dml语句组成,该组的dml语句要么全部成功要么全部失败. 说明:一组SQL,一个逻辑工作单位,执行整体修改或者整体回退. 事务的相关概念: 1.事务的提 ...
- Egret的按钮事件处理
首先要在exml内要设置有对应按钮的ID 2,编写TypeScript脚本: public mybutton:eui.Button; 函数内部:this.mybutton.addEventListen ...
- acl权限命令
1.查看acl命令 getfacl 文件名 #查看acl权限 2.设定acl权限命令 setfacl 选项 文件名 选项: -m 设置ACL权限 -x 删除指定的ACL权限 -b 删除所有的ACL设定 ...
- angular.uppercase()
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- JS 多选文件或者选择文件夹
<%--文件多选--%> <input type="file" name="file" id="file" multipl ...
- python获取函数注释 __doc__
使用 help 函数 可以查看 函数的注释内容 但是它也有点"添油加醋" 其实函数的注释被保存在 __doc__属性里面 PS 双下划线 def f(): "&quo ...
- 简单工厂模式demo
1. 简单工厂模式 domain的接口 public interface Color{ public void display(); } red public Class Red implements ...
- [Swift]LeetCode17. 电话号码的字母组合 | Letter Combinations of a Phone Number
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that th ...