User Tools

Site Tools


rpm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rpm [2009/09/29 13:13] – created 172.26.0.166rpm [2012/03/21 12:14] (current) – [Building RPMs] ikahugu
Line 1: Line 1:
-===== RPM Commands =====+====== Redhat Package Manager ======
  
 +====== Tips ======
 Check if a package is installed: Check if a package is installed:
 <code>$ rpm -qa | grep core <code>$ rpm -qa | grep core
Line 8: Line 9:
 List files in a certain package: List files in a certain package:
 <code>$ rpm -ql coreutils</code> <code>$ rpm -ql coreutils</code>
 +List files in an RPM:
 +<code>$ rpm -qlp apcupsd-3.14.7-1.x86_64.rpm</code>
 Manually install an rpm (as in, not using a repository with a package manager like yum): Manually install an rpm (as in, not using a repository with a package manager like yum):
 <code>$ sudo rpm -i VirtualBox-3.0.6_52128_rhel5-1.x86_64.rpm</code> <code>$ sudo rpm -i VirtualBox-3.0.6_52128_rhel5-1.x86_64.rpm</code>
 Manually remove an rpm: Manually remove an rpm:
 <code>$ sudo rpm -e VirtualBox</code> <code>$ sudo rpm -e VirtualBox</code>
 +
 +upgrade a package
 +<code>rpm -Uvh <package></code>
 +  * rpm -qa | less  :list all installed software packages
 +  * rpm -q httpd :show the version of the httpd package, if it is installed
 +  * rpm -qa | grep httpd : show all installed packages that have httpd in their name
 +  * rpm -ql httpd : list all files in the httpd package
 +  * rpm -qd httpd : list all documentation files in the httpd package
 +  * rpm -qc httpd : list all configuration files in the httpd package
 +  * rpm -qi httpd : display information about the package
 +  * rpm -V httpd : verify that the httpd package is correctly installed
 +  * rpm -qf /etc/passwd :determine which package the /etc/passwd file belongs to
 +To unistall a package:
 +<code>rpm -e <package name></code>
 +<code>rpm -qa | grep -i <packagename></code>
 +====== Building RPMs ======
 +
 +An RPM is a pre-compiled package containing binaries and config files, etc which can be installed using ''rpm'' or ''yum'' command line tools.  An SRPM or "source RPM" contains everything you need to rebuild a package.  Sometimes a binary RPM is not available, you can build a custom RPM using the SRPM file.
 +
 +  * [[http://wiki.centos.org/HowTos/SetupRpmBuildEnvironment|Setting up the RPM build environment]]
 +  * [[http://wiki.centos.org/HowTos/RebuildSRPM|Rebuilding Source RPMs]]
 +
 +Install ''rpmbuild'' (from the rpm-build package):
 +<code>$ sudo yum install rpm-build</code>
 +Setup your home directory's environment:
 +<code>$ cp -a /usr/src/redhat/ ~/rpmbuild
 +$ echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros</code>
 +Download an SRPM and build:
 +<code>$ wget http://mirrors.geekymedia.com/centos/python26-2.6-geekymedia1.src.rpm
 +$rpmbuild --rebuild EMBOSS-5.0.0-1.src.rpm</code>
 +Install with:
 +<code>$ sudo rpm -i ~/rpmbuild/RPMS/x86_64/python26-2.6-geekymedia1.x86_64.rpm</code>
 +If upgrading, use 
 +<code>$ sudo rpm -U ~/rpmbuild/RPMS/x86_64/python26-2.6-geekymedia1.x86_64.rpm</code>
 +====== Troubleshooting ======
 +
 +If you have problems with GPG errors, add a line like this to your ''~/.rpmmacros'':
 +<file>%_gpg_name Alan</file>
 +==== Dag Wieers' Repositories ====
 +----
 +
 +<file>[dag]
 +name=Dag RPM Repository for Red Hat Enterprise Linux
 +baseurl=http://dag.linux.iastate.edu/dag/redhat/el5/en/$basearch/dag
 +gpgcheck=1
 +enabled=1
 +</file>
 +
 +
 +<code> rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt</code>
 +Check more on this here http://wiki.centos.org/AdditionalResources/Repositories/RPMForge
 +
 +
 +==== PBONE REPOS ====
 +----
 +<file>
 +cd /etc/yum.repos.d
 +wget http://rpm.pidgin.im/centos/pidgin.repo
 +yum install pidgin
 +</file>
rpm.1254229983.txt.gz · Last modified: 2010/05/22 14:19 (external edit)