Loading...
Basic Linux

Software Package Administration

  • Software is the basic o any operating system, allowing you install and use different utilities.
  • In Linux, software is distributed through the use of packages, which contain the actual software files.
  • Each distribution of Linux has its own package manage system.
  • For RedHat, there are two package management systems :RPM &YUM.

Working with RPM:

  • RPM stands for RedHat Package Manger).
  • RPM is default package installation tool in Linux operating system.
  • By using RPM we can install, upgrade, query, verify and remove the packages.
  • Before diving into package management. Lets look at the naming convention used by the system to describe packages

Package Parameters:

postfix -2.6.6-2.e16.x86_64.rpm

Parameters Description:
postfix – package name
-2.6.6-2.e16 – version name
x86_64 – Architecture number
rpm – Extension of package

Method of Installation:
There are two ways of installations. They are

  1. Standalone
  2. Network

Standalone:

In this type, we can install the packages through any removable media or through dump.
Installing and Removing packages:
Syntax:

#rpm  <options>  <pkg-name>  --force  --aid

Parameters description:
Option:
i -> installs a given package
v -> verbose output
h -> shows hash progress when
u -> Upgrades a given package
e ->Removes a given package

–force -> Install the package with forcefully
–aid -> Install the package along with Dependencies
–nodeps -> To erase an package without dependencies

Quary Options (with -q):
Syntax:

#rmp <options> <pkg-name>

Options
c -> List all config files
d -> Lists all documentation files.
i -> Displays information about the package.
l -> Lists the file in a package.
s -> Status of the package.

Verify options (with -v):
-a -> Queries all packages
f -> Displays information about the specified file.

For installing an application.

#rpm  -ivh  nano-2.2.6-1.x86_64.rpm

For installing an application with forcefully.

#rpm  -ivh  nano-2.2.6-1.x86_64.rpm  --force

If you want to upgrade this package (because you know that it is already installed), you substitute the -i option for -U

#rpm  -Uvh  nano-2.2.6-1.x86_64.rpm

For uninstalling a package

#rpm  -e   nano

You can always reinstall the package at a later date if you keep the .rpm file on your system.

#rpm -ivh  -replacepkgs  nano-2.2.6-1.x86_64 .rpm

Tip:
A common situation to run into the job is having to install a package that is already installed. You don’t have to go through the trouble of uninstalling the package first only to reinstall it. You can use the -replacepkg option alongside the regular install option to over ride an existing installation.

Query the installed system package for nano:

#rpm -qa|grep  nano

Query the information from the nano package:

#rpm  -qi  nano

Suppose you are looking around on your new RedHat installation and a file but aren’t sure what it does.You can use the -f option to query the package that the file might belongs to, possibly giving you a better idea of what that file might be used for.

Find out where the /etc/syslog.conf file came from by doing the following.

#rmp  -qf  /etc/syslog  .conf

Use the -c option to find all config files.

#rmp  -qc  rsyslog

To find the documentation files for a given package.

#rpm  -qd  rsyslog

To listing of all files that come with the package.

#rpm  -ql   rsyslog

To find out whether a package has any dependencies:

#rpm  -qR  rsyslog

YUM

  • yum stands for yellowdog update modifier
  • In this section, we look at the exact same tasks, except this time. We use the more flexible yum utility.
  • The yum command has access to repositories where tons of packages are kept and can install, upgrade or remove them for you automatically.
  • yum also takes care of resolving and installing any dependencies for you, which the rpm command can’t do.
  • yum is an interactive tool which waits for the confirmation of a user.
  • yum is a default package management tool tool in RedHat O/S.
  • Using this tool we can install the required packages with dependencies.

Syantax:

yum   <options>  <command>  <packagename>

Option:
c -> Specifies the location of the config file.
q -> Specifies quit, no output.
y -> /to always answer yes to prompts.
v -> Provides verbose output

Commands:

yum cleanRemoves cached data
yum eraseRemoves a package from the system
yum listDisplay available packages
yum installInstall a package on the system
yum searchEnables you to search for a package
yum updateUpdates a package
yum grouplistDisplay available package groups
yum groupinstallInstall a package with in a group
yum groupremoveRemoves a packages with in a group

Leave a Reply

Your email address will not be published. Required fields are marked *