首页 > 代码库 > CentOS 6安装mock

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.rpmCentos5 32位  wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpmCentos6 64位  wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpmCentos6 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 /rootwget http://mirrors.163.com/fedora/releases/19/Everything/source/SRPMS/p/pigz-2.2.5-2.fc19.src.rpmuseradd mockbuildrpm -ivh pigz-2.2.5-2.fc19.src.rpmcd rpmbuild/SPECSrpmbuild -ba pigz.specrpm -ivh ../RPMS/x86_64/pigz-2.2.5-2.el6.x86_64.rpm

3,使用rpmbuild方式安装creatrepo

cd /rootwget http://createrepo.baseurl.org/download/createrepo-0.9.9-1.src.rpmuseradd skvidalrpm -ivh createrepo-0.9.9-1.src.rpmcd rpmbuild/SPECSrpmbuild -ba createrepo.specrpm -ivh ../RPMS/noarch/createrepo-0.9.9-1.noarch.rpm

4,使用rpmbuild方式安装mock

cd /rootwget http://mirrors.163.com/fedora/releases/19/Everything/source/SRPMS/m/mock-1.1.32-1.fc19.src.rpmrpm -ivh mock-1.1.32-1.fc19.src.rpmcd rpmbuild/SPECSrpmbuild -ba mock.specrpm -ivh ../RPMS/noarch/mock-1.1.32-1.el6.noarch.rpm

 

CentOS 6安装mock