I have been working on setting up some new CentOS Linux servers for a company I work for and one of the things I need to do is build a more current version of Ruby than what is available in the YUM repositories. To do this I am going to download an updated version of the Ruby Source RPM built for Fedora and then build the RPM’s from that. One of the commands required to build RPM’s is rpmbuild which is provided by the rpm-build RPM package as shown below.
Use yum whatprovides To Find Out What Installs rpmbuild On CentOS:
- [root@dev ~]# yum whatprovides *bin/rpmbuild*
- Loaded plugins: dellsysid, fastestmirror
- Loading mirror speeds from cached hostfile
- * addons: centos.mirror.netriplex.com
- * base: centos.omnispring.com
- * extras: mirror.sanctuaryhost.com
- * rpmforge: ftp-stud.fht-esslingen.de
- * updates: mirrors.tummy.com
- rpm-build-4.4.2.3-18.el5.x86_64 : Scripts and executable programs used to build packages
- Repo : base
- Matched from:
- Filename : /usr/bin/rpmbuild
- rpm-build-4.4.2.3-20.el5_5.1.x86_64 : Scripts and executable programs used to build packages
- Repo : updates
- Matched from:
- Filename : /usr/bin/rpmbuild
- [root@dev ~]#
As seen above the rpm-build package installs rpmbuild. To install rpmbuild on CentOS Linux use the below syntax from the command line.
Install rpmbuild On CentOS Linux Using Yum Package Manager:
- [root@dev ~]# yum install rpm-build
- Loaded plugins: dellsysid, fastestmirror
- Loading mirror speeds from cached hostfile
- * addons: mirror.anl.gov
- * base: centos.omnispring.com
- * extras: mirror.sanctuaryhost.com
- * rpmforge: apt.sw.be
- * updates: mirrors.tummy.com
- Setting up Install Process
- Resolving Dependencies
- --> Running transaction check
- ---> Package rpm-build.x86_64 0:4.4.2.3-20.el5_5.1 set to be updated
- --> Processing Dependency: elfutils for package: rpm-build
- --> Running transaction check
- ---> Package elfutils.x86_64 0:0.137-3.el5 set to be updated
- --> Processing Dependency: elfutils-libs-x86_64 = 0.137-3.el5 for package: elfutils
- --> Processing Dependency: libdw.so.1(ELFUTILS_0.130)(64bit) for package: elfutils
- --> Processing Dependency: libdw.so.1(ELFUTILS_0.127)(64bit) for package: elfutils
- --> Processing Dependency: libdw.so.1(ELFUTILS_0.126)(64bit) for package: elfutils
- --> Processing Dependency: libasm.so.1(ELFUTILS_1.0)(64bit) for package: elfutils
- --> Processing Dependency: libdw.so.1(ELFUTILS_0.122)(64bit) for package: elfutils
- --> Processing Dependency: libdw.so.1()(64bit) for package: elfutils
- --> Processing Dependency: libasm.so.1()(64bit) for package: elfutils
- --> Running transaction check
- ---> Package elfutils-libs.x86_64 0:0.137-3.el5 set to be updated
- --> Finished Dependency Resolution
- Dependencies Resolved
- ====================================================================================================================================
- Package Arch Version Repository Size
- ====================================================================================================================================
- Installing:
- rpm-build x86_64 4.4.2.3-20.el5_5.1 updates 301 k
- Installing for dependencies:
- elfutils x86_64 0.137-3.el5 base 215 k
- elfutils-libs x86_64 0.137-3.el5 base 183 k
- Transaction Summary
- ====================================================================================================================================
- Install 3 Package(s)
- Upgrade 0 Package(s)
- Total download size: 699 k
- Is this ok [y/N]: y
- Downloading Packages:
- (1/3): elfutils-libs-0.137-3.el5.x86_64.rpm | 183 kB 00:00
- (2/3): elfutils-0.137-3.el5.x86_64.rpm | 215 kB 00:00
- (3/3): rpm-build-4.4.2.3-20.el5_5.1.x86_64.rpm | 301 kB 00:00
- ------------------------------------------------------------------------------------------------------------------------------------
- Total 801 kB/s | 699 kB 00:00
- Running rpm_check_debug
- Running Transaction Test
- Finished Transaction Test
- Transaction Test Succeeded
- Running Transaction
- Installing : elfutils-libs 1/3
- Installing : elfutils 2/3
- Installing : rpm-build 3/3
- Installed:
- rpm-build.x86_64 0:4.4.2.3-20.el5_5.1
- Dependency Installed:
- elfutils.x86_64 0:0.137-3.el5 elfutils-libs.x86_64 0:0.137-3.el5
- Complete!
- [root@dev ~]#
After installing rpm-build the rpmbuild command will be available to you as shown in the below output from the CentOS Linux command line.
Verify rpmbuild Available And Verify rpmbuild Version:
- [root@dev ~]# rpmbuild --version
- RPM version 4.4.2.3