NETWORK OPERATING SYSTEMS By: Waqas Ahmed (C.E.O at Treesol)
Locating, Finding Installing, Upgrading and Deleting Packages
SEARCHING To find a program commands where they are: [root@tecmint ~]# which ls [root@tecmint ~]# which cd To find files and folders, etc.. [root@tecmint ~]# find name To tell find command from where to start use for example: [root@tecmint ~]# find / name Assignment check find command more options with man
PACKAGE MANAGEMET Package is a bundle of software files. In package you get program, documentation and sets of library files, etc.. The program we use in red hat for package management is rpm rpm is red hat package manager. yum is another program for package management. It stands for Yellowdog Updater Modified In rpm after install an package we need to go back and install dependencies. But yum solve this problem. It will automatically look and install all dependencies.
RPM command There are five basic modes for RPM command: Install : It is used to install any RPM package. Remove : It is used to erase, remove or un-install any RPM package. Upgrade : It is used to update the existing RPM package. Verify : It is used to query about different RPM packages. Query : It is used for the verification of any RPM package. Below is the list of rpm sites, where you can find and download all RPM packages: http://rpmfind.net http://www.redhat.com http://freshrpms.net/ http://rpm.pbone.net/
How to Check an RPM Signature Package Always check the PGP signature of packages before installing them on your Linux systems and make sure its integrity and origin is OK. Use the following command with checksig (check signature) option to check the signature of a package called pidgin. [root@tecmint]# rpm --checksig pidgin-2.7.9-5.el6.2.i686.rpm pidgin-2.7.9-5.el6.2.i686.rpm: rsa sha1 (md5) pgp md5 OK
How to Install an RPM Package For installing an rpm software package, use the following command with -i option. For example, to install an rpm package called pidgin-2.7.9-5.el6.2.i686.rpm. [root@tecmint]# rpm -ivh pidgin-2.7.9-5.el6.2.i686.rpm Preparing... ########################################### [100%] 1:pidgin ########################################### [100%] RPM command and options -i : install a package -v : verbose for a nicer display -h: print hash marks as the package archive is unpacked.
How to check dependencies of RPM Package before Installing Let s say you would like to do a dependency check before installing or upgrading a package. For example, use the following command to check the dependencies of BitTorrent-5.2.2-1-Python2.4.noarch.rpm package. It will display the list of dependencies of package. [root@tecmint]# rpm -qpr BitTorrent-5.2.2-1-Python2.4.noarch.rpm RPM command and options -q : Query a package -p : List capabilities this package provides. -R: List capabilities on which this package depends..
How to Install a RPM Package Without Dependencies If you know that all needed packages are already installed and RPM is just being stupid, you can ignore those dependencies by using the option nodeps (no dependencies check) before installing the package. [root@tecmint]# rpm -ivh --nodeps BitTorrent-5.2.2-1-Python2.4.noarch.rpm Preparing... ########################################### [100%] 1:BitTorrent ########################################### [100%] The above command forcefully install rpm package by ignoring dependencies errors, but if those dependency files are missing, then the program will not work at all, until you install them.
How to check an Installed RPM Package Using -q option with package name, will show whether an rpm installed or not. [root@tecmint]# rpm -q BitTorrent BitTorrent-5.2.2-1.noarch
How to Upgrade a RPM Package If we want to upgrade any RPM package U (upgrade) option will be used. One of the major advantages of using this option is that it will not only upgrade the latest version of any package, but it will also maintain the backup of the older package so that in case if the newer upgraded package does not run the previously installed package can be used again. [root@tecmint]# rpm -Uvh nx-3.5.0-2.el6.centos.i686.rpm Preparing... ########################################### [100%] 1:nx ########################################### [100%]
How to Remove an RPM Package Without Dependencies The nodeps (Do not check dependencies) option forcefully remove the rpm package from the system. But keep in mind removing particular package may break other working applications. [root@tecmint]# rpm -ev --nodeps vsftpd
What is YUM? YUM (Yellowdog Updater Modified) is an open source command-line as well as graphical based package management tool for RPM (RedHat Package Manager) based Linux systems. It allows users and system administrator to easily install, update, remove or search software packages on a systems. It was developed and released by Seth Vidal under GPL (General Public License) as an open source, means anyone can allowed to download and access the code to fix bugs and develop customized packages. YUM uses numerous third party repositories to install packages automatically by resolving their dependencies issues.
Install a Package with YUM To install a package called Firefox 14, just run the below command it will automatically find and install all required dependencies for Firefox. [root@tecmint]# yum install firefox [root@tecmint]# yum -y install firefox The above first command will ask confirmation before installing any package on your system. If you want to install packages automatically without asking any confirmation, use option -y as shown in second example.
Removing a Package with YUM To remove a package completely with their all dependencies, just run the following command as shown below. [root@tecmint]# yum remove firefox [root@tecmint]# yum -y remove firefox Same way the above first command will ask confirmation before removing a package. To disable confirmation prompt just add option -y as shown in second example above.
Updating a Package using YUM Let s say you have outdated version of MySQL package and you want to update it to the latest stable version. Just run the following command it will automatically resolves all dependencies issues and install them. [root@tecmint]# yum update mysql
Search for a Package using YUM If you don t remember the exact name of the package, then use search function to search all the available packages to match the name of the package you specified. For example, to search all the packages that matches the word. [root@tecmint]# yum search vsftpd
List all Available Packages using YUM To list all the available packages in the Yum database, use the below command. [root@tecmint]# yum list less
List all Installed Packages using YUM To list all the installed packages on a system, just issue below command, it will display all the installed packages. [root@tecmint]# yum list installed less
Clean Yum Cache By default yum keeps all the repository enabled package data in /var/cache/yum/ with each sub-directory, to clean all cached files from enabled repository, you need to run the following command regularly to clean up all the cache and make sure that there is nothing unnecessary space is using. We don t want to give the output of the below command, because we like to keep cached data as it is. [root@tecmint]# yum clean all
View History of Yum To view all the past transactions of yum command, just use the following command. [root@tecmint]# yum history
ASSIGNMENT Plz use all the commands Practically in home. That we done today practically in class.