CentOS 6安装mock
最近工作中需要用到mock,这里介绍两种安装方式。本文的环境为CentOS 6.4 x86_64。
一,使用yum安装mock
安装第三方yum源RPMForge
Centos5 64位 wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm Centos5 32位 wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm Centos6 64位 wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm Centos6 32位 wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
安装下载回来的rpm包
yum install rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
安装mock
yum install mock
二,使用rpmbuild方式安装mock
1,安装基础包:
yum install rpm-build python python-devel python-decoratortools libxml2-python python-deltarpm make gcc gcc-c++ wget yum-utils zlib zlib-devel ncompress
2,使用rpmbuild方式安装pigz(应该是个压缩工具,依赖zlib zlib-devel ncompress)
cd /root wget http://mirrors.163.com/fedora/releases/19/Everything/source/SRPMS/p/pigz-2.2.5-2.fc19.src.rpm useradd mockbuild rpm -ivh pigz-2.2.5-2.fc19.src.rpm cd rpmbuild/SPECS rpmbuild -ba pigz.spec rpm -ivh ../RPMS/x86_64/pigz-2.2.5-2.el6.x86_64.rpm
3,使用rpmbuild方式安装creatrepo
cd /root wget http://createrepo.baseurl.org/download/createrepo-0.9.9-1.src.rpm useradd skvidal rpm -ivh createrepo-0.9.9-1.src.rpm cd rpmbuild/SPECS rpmbuild -ba createrepo.spec rpm -ivh ../RPMS/noarch/createrepo-0.9.9-1.noarch.rpm
4,使用rpmbuild方式安装mock
cd /root wget http://mirrors.163.com/fedora/releases/19/Everything/source/SRPMS/m/mock-1.1.32-1.fc19.src.rpm rpm -ivh mock-1.1.32-1.fc19.src.rpm cd rpmbuild/SPECS rpmbuild -ba mock.spec rpm -ivh ../RPMS/noarch/mock-1.1.32-1.el6.noarch.rpm