搭建自己的yum源服务器(复制www.jasonlitka.com的yum源)
1、安装yum工具集
yum install yum-utils yum-metadata-parser yum-fastestmirror yum-updatesd createrepo
2、安装yum-arch【默认套件里没有,需单独安装】
rpm -ivh ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/x86_64/RPMS/yum-arch-2.2.2-2.el5.kb.noarch.rpm
rpm -ivh ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/yum-arch-2.2.2-2.el5.kb.noarch.rpm
3、配置需要复制的yum源(以便于下载所需资源)
cat > /etc/yum.repos.d/utterramblings.repo
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
4、创建
本地资源目录
mkdir -p /data/yum/jasonlitka
5、下载所需资源
cd /data/yum/jasonlitka
yumdownloader yum-utils yum-metadata-parser yum-fastestmirror yum-updatesd createrepo
yumdownloader mysql mysql-server mysql-devel mysqlclient15 perl-DBD-MySQL perl-DBI
yumdownloader php php-common php-cli php-devel php-pdo php-memcache php-mysql php-mbstring php-json php-gd
wget ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/x86_64/RPMS/yum-arch-2.2.2-2.el5.kb.noarch.rpm
wget ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/yum-arch-2.2.2-2.el5.kb.noarch.rpm
6、RPM分析,会在目录下产生 heaers 目录:
yum-arch /data/yum/jasonlitka
7、createrepo生成
XML metadata,会在相应目录下创建repodata目录
createrepo /data/yum/jasonlitka
8、配置httpd目录
ln -s /data/yum/jasonlitka /var/www/html/
/etc/init.d/httpd start
至此,服务器端配置完毕
9、客户端配置
cat > /etc/yum.repos.d/custom.repo
[custom]
name=custom Repo from http://www.jasonlitka.com/
baseurl=http://192.168.1.1/jasonlitka/
enabled=1
gpgcheck=0
10、测试
yum install mysql-server
11、增加一个rpm包需要先yumdownloader 软件包,再执行第6、7步即可
yumdownloader subversion
yum-arch /data/yum/jasonlitka
createrepo /data/yum/jasonlitka