Package Management With RPM
Package Management With RPM
Package Management With RPM
Packages
• Most software applications designed for Linux
or Unix systems are distributed as packages,
which are archives that contain the pre-
compiled binary software files, installation
scripts, configuration files, dependency
requirements, and other details about the
software
Linux Package Manager
Two type of Package manager
• RPM(Redhat Package Manager)
Can’t install automatic dependencies of any
package
• YUM(Yellowdog updater Modifer )
Can’t install automatic dependencies of any
package
RedHat Package Manager
With RPM
• system updates easy
• Installing, uninstalling, and upgrading RPM
packages can be accomplished with short
commands.
• database of installed packages and their files
are maintained
RPM modes of Operation
• RPM packages typically have file names like foo-1.0-1.i386.rpm. The file
name includes the package name (foo), version (1.0), release (1), and
architecture (i386).
• To install a package, log in as root and type the following command at a
shell prompt:
rpm -ivh foo-1.0-1.i386.rpm
i –install
v – verbose
h - hash
To upgrade an installed package
• To upgrade a package,
• However, if you want to install the package anyway, you can use the --
replacepkgs option, which tells RPM to ignore the error:
• If you attempt to install a package that contains a file which has already
been installed by another package, the following is displayed:
rpm -e foo
Notice that we used the package name foo, not the name of the original
package file foo-1.0-1.i386.rpm. To uninstall a package, replace foo with
the actual package name of the original package.
• Rpm –e tar –nodeps
• Used to remove package forcefully
Upgrading package
If you have just downloaded a large number of different packages, and you
only want to upgrade those packages that are already installed on your
system, freshening does the job.
• The RPM database stores information about all RPM packages installed in
your system. It is stored in the directory /var/lib/rpm/, and is used to
query what packages are installed, what versions each package is, and any
changes to any files in the package since installation, among others.
• To query this database, use the -q option. The rpm -q package name
command displays the package name, version, and release number of the
installed package package name . For example,
• Using rpm -q foo to query installed package foo might generate the
following output:
foo-2.0-1
Querying a package
• rpm –qa // list all installed packages
• rpm –q httpd // Checking if a package is installed or not
• rpm –ql httpd List all the files for a package
Verifying a package