YUM仓库搭建纯文本
来源:互联网 发布:plc编程软件在哪下载 编辑:程序博客网 时间:2024/06/05 18:29
操作系统为RHEL5 (本实验稍作修改,可以做PXE网络装机服务器)
1.配置IP
[root@localhost ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:4E:07:88
inet addr:172.16.10.18 Bcast:172.16.10.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe4e:788/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:98 errors:0 dropped:0 overruns:0 frame:0
TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14341 (14.0 KiB) TX bytes:17614 (17.2 KiB)
Interrupt:59 Base address:0x2024
2.挂装光盘
[root@localhost ~]# mount /dev/cdrom /media/
mount: block device /dev/cdrom is write-protected, mounting read-only
mount: /dev/cdrom already mounted or /media/ busy
3.安装vsftpd服务器,并配置
[root@localhost ~]# cd /media/Server/
[root@localhost Server]# rpm -ivh vsftpd-2.0.5-16.el5_4.1.i386.rpm
warning: vsftpd-2.0.5-16.el5_4.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: failed to stat /media/RHEL_5.5 i386 DVD: 没有那个文件或目录
Preparing... ########################################### [100%]
1:vsftpd ########################################### [100%]
[root@localhost ~]# mkdir /var/ftp/rhel5
###[root@localhost ~]# mkdir /var/ftp/other
[root@localhost ~]# cp -rpf /media/* /var/ftp/rhel5/
[root@localhost ~]# service vsftpd start
为 vsftpd 启动 vsftpd: [确定]
[root@localhost ~]# chkconfig vsftpd on
[root@localhost ~]# cp -rfp /media/* /var/ftp/rhel5/ #######(同时,将比赛用的所有软件包放到other目录下)
4.安装createrepo工具后,使用createrepo工具建立仓库数据文件
[root@localhost Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: failed to stat /media/RHEL_5.5 i386 DVD: 没有那个文件或目录
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
………………………………………………………………………………………………………………
[root@localhost ~]# cd /var/ftp/rhel5/Server/
[root@localhost Server]# createrepo -g repodata/comps-rhel5-server-core.xml ./
2348/2348 - coolkey-devel-1.1.0-14.el5.i386.rpm m
Saving Primary metadata
Saving file lists metadata
Saving other metadata
………………………………………………………………………………………………………………
[root@localhost Server]# cd /var/ftp/rhel5/Cluster
[root@localhost Cluster]# createrepo -g repodata/comps-rhel5-cluster.xml ./
32/32 - Cluster_Administration-ru-RU-5.2-1.noarch.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
………………………………………………………………………………………………………………
[root@localhost ~]# cd /var/ftp/rhel5/ClusterStorage/
[root@localhost ClusterStorage]# createrepo -g repodata/comps-rhel5-cluster-st.xml ./
39/39 - perl-Config-General-2.40-1.el5.noarch.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
………………………………………………………………………………………………………………
[root@localhost VT]# createrepo -g repodata/comps-rhel5-vt.xml ./
36/36 - python-virtinst-0.400.3-9.el5.noarch.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
5.在ftp共享目录下,创建benet.repo文件
[root@localhost ~]# cd /var/ftp/
[root@localhost ftp]# vi benet.repo
[Server]
name=Server share source rpm packages
baseurl=ftp://172.16.10.18/rhel5/Server
enabled=1
gpgcheck=0
[Cluster]
name=Cluster
baseurl=ftp://172.16.10.18/rhel5/Cluster
enabled=1
gpgcheck=0
[ClusterStorage]
name=ClusterStorage
baseurl=ftp://172.16.10.18/rhel5/ClusterStorage
enabled=1
gpgcheck=0
[VT]
name=VT
baseurl=ftp://172.16.10.18/rhel5/VT
enabled=1
gpgcheck=0
#[Other]
#name=other soft
#baseurl=ftp://172.16.10.18/rhel5/other
#enabled=1
#gpgcheck=0
客户端的操作
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# wget ftp://172.16.10.18/benet.repo
--2013-03-31 21:18:55-- ftp://172.16.10.18/benet.repo
=> `benet.repo'
Connecting to 172.16.10.18:21... 已连接。
正在以 anonymous 登录 ... 登录成功!
==> SYST ... 完成。 ==> PWD ... 完成。
==> TYPE I ... 完成。 ==> 不需要 CWD。
==> SIZE benet.repo ... 370
==> PASV ... 完成。 ==> RETR benet.repo ... 完成。
长度:370
100%[======================================>] 370 --.-K/s in 0s
2013-03-31 21:18:55 (23.7 MB/s) - `benet.repo' saved [370]
[root@localhost yum.repos.d]# ls
benet.repo rhel-debuginfo.repo
##
疑难问题:当将所有的比赛用的文件包都放到另外一个ftp目录下other下的时候,怎么用createrepo -g 创建库数据。如果无法创建,就会弹出如下信息
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Cluster | 1.1 kB 00:00
ClusterStorage | 1.1 kB 00:00
ftp://172.16.10.18/rhel5/other/repodata/repomd.xml: [Errno 4] IOError: [Errno ftp error] 550 Failed to change directory.
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: Other. Please verify its path and try again
本文出自 “技术成就未来” 博客,请务必保留此出处http://jishuweiwang.blog.51cto.com/6977090/1208372
- YUM仓库搭建纯文本
- yum仓库的搭建
- 搭建本地yum仓库
- 搭建本地yum仓库
- 本地yum仓库搭建
- 搭建yum仓库
- yum仓库的搭建
- 搭建yum私有仓库
- YUM+NTP服务器的搭建 (RHEL6.1搭建) 纯文本
- yum仓库搭建与管理
- 第三方yum仓库搭建
- centos7 yum仓库的搭建
- 第三天(2) yum仓库搭建
- 如何手工搭建本地Yum仓库
- yum第三方软件仓库的搭建
- CentOS7通过apache搭建yum仓库
- 基于Nginx本地Yum仓库的搭建
- postfix和dovecot纯文本搭建
- NFS+rsync+inotify镜像
- postfix和dovecot纯文本搭建
- squid透明代理纯文本搭建
- LVS负载均衡的搭建纯文本
- LVS+keepalived构建高可用负载均衡群集实验纯文本
- YUM仓库搭建纯文本
- YUM+NTP服务器的搭建 (RHEL6.1搭建) 纯文本
- Nginx负载均衡纯文本搭建
- MYSQL配置文档(史上最具体讲解)
- mysql错误代码与解决方法
- Centos 6.2 修改file和process限制
- sort、uniq学习笔记
- sed学习笔记
- cut学习笔记