Installing Packages in GNU/Linux

Redhat Package Manager - RPM
---------------------------------------------------------
* Can install, remove, query, and verify the software on your system
* Can run as root only, since it can change the underlying system.
* Has frontends like Yum and up2date
* Has Five basic modes of operation :
Installing - rpm -i
Uninstalling - rpm -e
Upgrading - rpm -U
Querying - rpm -q
Verifying - rpm -V

Querying:- 


Examples :


(1) rpm -qa | more -> what software you have installed on your system.


-q -> Query option
-a -> List all the packages


(2) rpm -qf /etc/sysctl.conf


-f -> Display the package that contains a particular file.


(3) rpm -qpl yum-2.0.8-1.src.rpm


-p -> Query a (uninstalled package file).
-l -> List the files in packages.


(4) rpm -qilsdc quota


-i -> displays package information including name, description, release, size, build date, install date, vendor, and other miscellaneous information.
-s -> displays the state of all the files in the package.
-d -> displays a list of files marked as documentation (man pages, info pages, READMEs, etc.).
-c -> displays the configuration files.


(5) rpm -q what requires package


print the other packages that depends on the package, installed


(6) rpm -qpR yum-2.0.8-1.src.rpm


to get the list of packages and programs that are required for instalation of the yum-2.0.8-1.src.rpm



(7) rpm -ivh yum-2.0.8-1.src.rpm


-v -> verbose
-h -> print hashes



RPM is a very useful tool for both managing your system and diagnosing and fixing problems. The best way to make sense of all the options is to look at some examples.

  • Let's say you delete some files by accident, but you aren't sure what you deleted. If you want to verify your entire system and see what might be missing, you would enter:
    rpm -Va
              
    If some files are missing, or appear to have been corrupted, you should probably either re-install the package or uninstall, then re-install the package.
  • Let's say you run across a file that you don't recognize. To find out which package owns it, you would enter:
    rpm -qf /usr/X11R6/bin/ghostview
              
    The output would look like:
    gv-3.5.8-10
              
  • We can combine the above two examples in the following scenario. Say you are having problems with /usr/bin/paste. You would like to verify the package that owns that program but you don't know which package that is. Simply enter:
    rpm -Vf /usr/bin/paste
                
    and the appropriate package will be verified.
  • Want to find more about a particular program? You can find out by entering the following to locate the documentation which came with the package that "owns" that program (in this case ispell):
    rpm -qdf /usr/bin/md5sum
                
    The output would be:
    /usr/share/doc/textutils-2.0a/NEWS
    /usr/share/doc/textutils-2.0a/README
    /usr/info/textutils.info.gz
    /usr/man/man1/cat.1.gz
    /usr/man/man1/cksum.1.gz
    /usr/man/man1/comm.1.gz
    /usr/man/man1/csplit.1.gz
    /usr/man/man1/cut.1.gz
    /usr/man/man1/expand.1.gz
    /usr/man/man1/fmt.1.gz
    /usr/man/man1/fold.1.gz
    /usr/man/man1/head.1.gz
    /usr/man/man1/join.1.gz
    /usr/man/man1/md5sum.1.gz
    /usr/man/man1/nl.1.gz
    /usr/man/man1/od.1.gz
    /usr/man/man1/paste.1.gz
    /usr/man/man1/pr.1.gz
    /usr/man/man1/ptx.1.gz
    /usr/man/man1/sort.1.gz
    /usr/man/man1/split.1.gz
    /usr/man/man1/sum.1.gz
    /usr/man/man1/tac.1.gz
    /usr/man/man1/tail.1.gz
    /usr/man/man1/tr.1.gz
    /usr/man/man1/tsort.1.gz
    /usr/man/man1/unexpand.1.gz
    /usr/man/man1/uniq.1.gz
    /usr/man/man1/wc.1.gz
              
  • Let's say you find a new sndconfig RPM, but you don't know what it is. To find out some information on it, enter:
    rpm -qip sndconfig-0.48-1.i386.rpm
                
    The output would be:
    Name        : sndconfig                Relocations: (not relocateable)
    Version     : 0.48                          Vendor: Red Hat
    Release     : 1                         Build Date: Mon 10 Jul 2000 02:25:40
    Install date: (none)                    Build Host: porky.devel.redhat.com
    Group       : Applications/Multimedia   Source RPM: sndconfig-0.48-1.src.rpm
    Size        : 461734                       License: GPL 
    Packager    : Red Hat 
    Summary     : The Red Hat Linux sound configuration tool.
    Description :
    Sndconfig is a text based tool which sets up the configuration files
    you'll need to use a sound card with a Red Hat Linux system.
    Sndconfig can be used to set the proper sound type for programs which
    use the /dev/dsp, /dev/audio and /dev/mixer devices.  The sound
    settings are saved by the aumix and sysV runlevel scripts.
                

  • Now you want to see what files the koules RPM installs. You would enter:
    rpm -qlp sndconfig-0.48-1.i386.rpm
              
    The output is:
    /usr/sbin/pnpprobe
    /usr/sbin/sndconfig
    /usr/share/locale/cs/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/da/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/de/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/es/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/fr/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/hu/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/id/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/is/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/it/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/ko/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/no/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/pt/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/pt_BR/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/ro/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/ru/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/sk/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/sl/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/sr/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/sv/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/tr/LC_MESSAGES/sndconfig.mo
    /usr/share/locale/uk/LC_MESSAGES/sndconfig.mo
    /usr/share/man/man8/pnpprobe.8.gz
    /usr/share/man/man8/sndconfig.8.gz
    /usr/share/sndconfig/sample.au
    /usr/share/sndconfig/sample.midi




0 comments:

Post a Comment