SOFTWARE MANAGEMENT:
To manage the software in Linux, two utilities are used:
1. RPM – REDHAT PACKAGE MANAGER
2. YUM – YELLOWDOG UPDATER MODIFIED
RPM –REDHAT PACKAGE MANAGER
RPM is a package managing system (collection of tools to manage software packages). RPM is a
powerful software management tool for installing, uninstalling, verifying, querying and
updating software packages. RPM is a straight forward program to perform the software
management tasks.
Features:
• RPM can verify software packages.
• RPM can be served as a powerful search engine to search for software’s.
• Components, software’s etc can be upgraded using RPM without having to reinstall them
• Installing, reinstalling can be done with ease using RPM
• During updates RPM handles configuration files carefully, so that the customization is not lost.
LAB WORK:-
•To check all the installed packages in the system
#rpm –qa (where "q" stands for query, and "a" stands for all)
•To check whether a package is installed or not out of the list of installed package.
#rpm –qa package name (or) #rpm –q package name
#rpm –qa vsftpd (or) #rpm –q vsftpd
•One more method of checking the installed package, when you are not sure about the
package name, like whether it starts with capital letter and full name etc.
#rpm –qa | grep –i package name
#rpm –qa |grep –i vsft*
•To install a package using rpm command and check whether it is installed properly or not.
#rpm –qa finger
•To install the package first we need to be in the directory of the package
#cd /var/ftp/pub/rhel6/packages
#ls | grep -i finger
•To install the package the syntax is
#rpm –ivh package name
#rpm –ivh finger-0.17-39.el6.i686.rpm
•To check whether it is installed or not
#rpm –qa finger
•Check the installed package by using it command(finger is used to check user’s details.)
#finger user name
#finger ktuser
•To remove a package or uninstall the package
#rpm –e package name
#rpm –e finger
Verify it by #rpm –q finger (or) rpm –qa finger
•To see the information about the package before installing
•To see the info about a particular package which is not installed, move to the directory
where you have kept the packages.
#cd /var/ftp/pub/rhel6/packages
#ls -l |grep -i finger
•To see the info of a package
#rpm –qip package name (where q is for query, i is for install and p is for package)
#rpm –qip finger-0.17-39-el6.1686.rpm
• To see the information or details about the installed package
#rpm –qi package name
#rpm –qi vsftpd
To check the package of a particular command:
• To check the package of a particular command, first check the installed location of a command
#which command name
#which cat
• Now, use the following command,
#rpm –qf path of the command
#rpm –qf /bin/cat
To install a package forcefully:
• Before installing a package forcefully, first understand a situation where we need this force option.
• Let me corrupt one command and show you how to install its package forcefully.
• First check the package of the command we are going to corrupt. Let say mount command
#which mount
#rpm –qf /bin/mount
Okay, so we know the package of mount let’s copy other commands content over mount command.
Let copy date command’s contents over mount command.
#cp /bin/date /bin/mount
Now when you run mount command it will show date, that means it is corrupte
#mount
#date
#rpm –ivh util-linux-ng 2.17.2-6.el6.i686
#cd /var/ftp/pub/rhel6/packages/
It says the package is already install, check by using mount command whether it is working
fine.
#mount
Oops…!!! It isn’t fixed yet, now in such to force the installation to be done, the syntax is
#rpm –ivh package name - - force
#rpm –ivh util-linux-ng 2.17.2-6.el6.i686 - -force
• To see the configuration files of the installed package
#rpm –qlc package name
#rpm -qlc vsftpd
• To see the directory with which a particular package is associated.
#rpm –qld package name
#rpm –qld vsftpd
• To install a package without installing dependencies
• Some rpm requires some other packages to be installed before it can be installed; this
requirement is termed as ‘dependency’. This means that before installing a package we
need to install the required packages first, so that it can work properly.
• But sometimes we can skip installing the dependency, if we don’t have that dependent
software with us.
• The syntax for it is
#rpm –ivh package name - -nodeps
#rpm -ivh util-linux-ng 2.17.2-6.el6.i686 - -nodeps
To update a particular package
• To update a package the syntax is
#rpm –Uvh package name
#rpm –Uvh vsftpd -2.2.4
To check the changes are made after installation of package
• First let’s make some changes in the configuration file of a package say vsftpd
#vim /etc/vsftpd/vsftpd.conf
Now run the following command and check for the result
#vim /etc/vsftpd/vsftpd.conf
#rpm -v vsftpd
Linux RPM Commands: Install, Uninstall, Verify Packages,Linux RPM Commands Every Admin Must Know | Install, Uninstall, Query, Update