Call us: 1-347-414-9117

CentOS, like Fedora and Redhat, uses the RPM format to manage package (software) installation. Modern versions of Redhat-based operating systems benefit from the Yum package management tool. Yum, the "Yellowdog Updater, Modified", checks and installs package dependencies automatically if available. First, well get some of the common terminology taken care of, then well discuss package management using Yum, and finally, package management using RPM.

 

Packages

Packages in this case refers to software in the form of RPM bundles. Packages contain compressed archives with files, documentation, management scripts, and dependency information.

Repositories

Repositories refer to a location containing software packages. Yum uses repository locations to automatically install the correct package or series of packages.

Dependencies

Dependencies refer to libraries or other pieces of software necessary for any given software to run. For example, you want to install somepackage-0.123-4.i386.rpm. In order for this software to install, any software that it needs to run will need to be installed either automatically through Yum or manually using RPMs.

Package Naming Conventions

Proper RPM packages adhere to a standard naming convention. The name may seem a bit long, but knowing how to identify a package based on its naming convention helps considerably when trying to find the correct software. Packages are usually referred to using either

package name (example, somepackage)

package name with version and relase (example, somepackage-0.123-4

package name with CPU architecture (example, somepackage.i386)

Yum lists packages as package-name.arch. We generally only support the i386 and x86_64 architectures at NanoServers, i386 being suitable for all Intel-compatible processors, and x86_64 compatible with any 64-bit capable AMD or Intel processor. You may also see some packages listed as i586 or i686 architecture, these refer to packages compiled with additional support for processor-sepcific CPU extensions.

 

Managing packages in CentOS using Yum

To install software using the Yum package manager you should be either logged in as root or as a user with sudo access. If, for example, you are admin2 and have sudo access, you would install somepackage-0.123-4.i386.rpm by using the following command:

 

sudo yum install somepackage

 

if you were logged in as root, you the sudo command is not necessary. Notice it isnt necessary to use the full package name. Yum checks your system architecture and its repository list to determine the best package to install. If you already have a version of somepackage installed but would like to update it, you would use

 

sudo yum update somepackage

 

To update all software on the server, you would type

 

sudo yum update

 

You may also allow CentOS to check for system updates daily. To set this automated feature, you would type

 

sudo chkconfig --level 345 yum on; service yum start

 

Conversely, you may remove software from CentOS using yum

 

sudo yum remove somepackage

 

Generally speaking, these will be the most common commands you would need to use to manage packages in CentOS. When you get a server with CentOS installed, the default repositories are already added. In the event that you must install an RPM package outside of the yum package manager, here are a few common commands to employ. Lets say you need to install somepackage-0.123-4.i386.rpm but the package isnt available through any of your Yum repositories. Youve found the package and the CPU architecture matches, youve saved the rpm file to your server, and you would like to install it. Navigate to the folder with the rpm package and type

 

sudo rpm -ivh somepackage-0.123-4.i386.rpm

 

if you are logged in as root you may omit the sudo command. To break down whats being done, the -ivh flag after rpm tells RPM to install, verbosely, with hashmarks. This means it will install the software, print to screen any messages, and will show a progress bar using the # symbol. If you had, for example, somepackage-0.111-3.i386.rpm installed already and would like to update it, you would use

 

sudo rpm -Uvh somepackage-0.123-4.i386.rpm

 

Here, the -Uvh tells RPM to update, verbosely, and with hashmarks. If you have the package installed and you would like to remove it, you would use

 

sudo -e somepackage-0.123-4.i386.rpm

 

You cannot remove a package that meets another installed packages dependencies. If you attempt to remove a package and are unsuccessful due to this, you may type

 

rpm -q --whatrequires somepackage-0.123-4.i386.rpm

 

There are quite a few additional aspects to both Yum and RPM package management, but these are the most common. If you require more information on Yum or RPM, please visit

 

http://www.rpm.org

 

http://CentOSproject.org/wiki/Tools/yum