Search This Blog

Showing posts with label rpm. Show all posts
Showing posts with label rpm. Show all posts

Tuesday, December 6, 2011

rpm rebuild

Most of the time you are not able to run any rpm queries such as\
rpm -qa
it just stuck after giving the command.

Well this comes to your rescue.

http://www.cyberciti.biz/tips/rebuilding-corrupted-rpm-database.html

Tuesday, July 26, 2011

How to Download RPM using yum?

For example:
Consider a scenario where you would only need to download the rpm and not necessarily install it.

You will have to install an additional rpm called yum-downloadonly
yum install yum-downloadonly

Once the above rpm is installed all you have to do is run below command.
yum install sendmail-cf-8.13.8-2.el5 -y --downloadonly --downloaddir=/tmp

(In above example sendmail-cf-8.13.8-2.el5 rpm is downloaded and stored in /tmp .in your case it could be anything.)

The above command will only download the rpm and not necessarily installed it.

Note:
(I would recommend you to run above command where rpm getting downloaded is not already installed in my case it is sendmail-cf-8.13.8-2.el5 .Otherwise you will get an error saying rpm is already installed.You may remove the rpm using rpm -e )

Thursday, March 17, 2011

All about rpm.

RPM (Redhat package Manager).
There have been lot of changes since it was named .So RPM doesnt only relates to redhat distribution of linux .Now most of linux distributions supports RPM package manager.


Topic covered so far

1) RPM Naming convention.
2) How to check list of installed rpm(s).
3) How to list file(s) stored in rpm.


1) RPM Naming convention.

name-version-release.architecture.rpm
for example.

samba-32bit-3.4.2 -1.1.3.1.x8664.rpm

2) How to check list of installed rpm(s).  

run rpm -qa to list all the installed rpm.
-q : Query rpm.
-a : Query all installed packages. 


 3) How to list file(s) stored in rpm. 

use rpm -qpl to find the list of files included in rpm. 
$ rpm -qpl myrpm-1-0.noarch.rpm
/usr/local/bin/myscript.sh
 


 -p, --package PACKAGE_FILE :
              Query  an  (uninstalled) package PACKAGE_FILE.  The PACKAGE_FILE may be specified as an ftp or http style URL, in which case the package header will be downloaded and queried.  See  FTP/HTTP  OPTIONS for information on rpmâs internal ftp and http client support. The PACKAGE_FILE argument(s), if not a binary package, will be interpreted as an ASCII package manifest.  Comments are permitted, starting  with  a  â#â,  and each line of a package manifest file may include white space separated glob expressions, including URLâs with remote glob expressions, that will be expanded to paths that  are substituted in place of the package manifest as additional PACKAGE_FILE arguments to the query.


-l :
              List files in package.

In above example rpm myrpm-1-0.noarch.rpm contains script named /usr/local/bin/myscript.sh