0

LFCS software management

Welcome to post 31 of my 100 day challenge. Checkout my introduction for some background.

This is post thirteen of my LFCS series. In this post we will discuss installing software packages on Linux.

You can go back to the overview post for a brief introduction or take a look at post one for instructions on setting up the exam practice system which I will be using throughout this series.

Software management

We install and manage software on Fedora based distributions such as RedHat and CentOS with the yum utility. Yum stands for Yellowdog Updater Modified and is a dependency aware package management solution which utilises the lower level RPM package tool. You can use either for your needs but I recommend that you stick with yum unless you need to delve any deeper as yum will handle dependencies and is generally easier to use.

You can install a package with the following command:

[root@centospractice ~]# yum install htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirroring.pulsant.co.uk
 * extras: mirror.econdc.com
 * rpmforge: mirror.nl.leaseweb.net
 * updates: mirror.econdc.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:1.0.3-1.el6.rf will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================================================================================================
 Package Arch Version Repository Size
===============================================================================================================================================================================================================
Installing:
 htop x86_64 1.0.3-1.el6.rf rpmforge 87 k
Transaction Summary
===============================================================================================================================================================================================================
Install 1 Package(s)
Total download size: 87 k
Installed size: 209 k
Is this ok [y/N]: y
Downloading Packages:
htop-1.0.3-1.el6.rf.x86_64.rpm | 87 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
 Installing : htop-1.0.3-1.el6.rf.x86_64 1/1
 Verifying : htop-1.0.3-1.el6.rf.x86_64 1/1
Installed:
 htop.x86_64 0:1.0.3-1.el6.rf
Complete!

You can uninstall a software package with the following command:

[root@centospractice ~]# yum remove htop
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:1.0.3-1.el6.rf will be erased
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================================================================================================
 Package Arch Version Repository Size
===============================================================================================================================================================================================================
Removing:
 htop x86_64 1.0.3-1.el6.rf @rpmforge 209 k
Transaction Summary
===============================================================================================================================================================================================================
Remove 1 Package(s)
Installed size: 209 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
 Erasing : htop-1.0.3-1.el6.rf.x86_64 1/1
 Verifying : htop-1.0.3-1.el6.rf.x86_64 1/1
Removed:
 htop.x86_64 0:1.0.3-1.el6.rf
Complete!

You can update an existing package with the following command:

[root@centospractice ~]# yum update sudo
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.melbourne.co.uk
 * extras: mirrors.melbourne.co.uk
 * rpmforge: nl.mirror.eurid.eu
 * updates: mirrors.coreix.net
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package sudo.x86_64 0:1.8.6p3-7.el6 will be updated
---> Package sudo.x86_64 0:1.8.6p3-15.el6 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================================================================================================
 Package Arch Version Repository Size
===============================================================================================================================================================================================================
Updating:
 sudo x86_64 1.8.6p3-15.el6 base 704 k
Transaction Summary
===============================================================================================================================================================================================================
Upgrade 1 Package(s)
Total download size: 704 k
Is this ok [y/N]: y
Downloading Packages:
sudo-1.8.6p3-15.el6.x86_64.rpm | 704 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
 Updating : sudo-1.8.6p3-15.el6.x86_64 1/2
 Cleanup : sudo-1.8.6p3-7.el6.x86_64 2/2
 Verifying : sudo-1.8.6p3-15.el6.x86_64 1/2
 Verifying : sudo-1.8.6p3-7.el6.x86_64 2/2
Updated:
 sudo.x86_64 0:1.8.6p3-15.el6
Complete!

You can search for a package to be installed:

[root@centospractice ~]# yum search git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.melbourne.co.uk
 * extras: mirrors.melbourne.co.uk
 * rpmforge: mirror.nl.leaseweb.net
 * updates: mirror.for.me.uk
============================================================================================== N/S Matched: git ===============================================================================================
cogito.noarch : The Cogito Version Control System
emacs-git.noarch : Git version control system support for Emacs
emacs-git-el.noarch : Elisp source files for git version control system support for Emacs
git-all.noarch : Meta-package to pull in all git tools
git-cvs.noarch : Git tools for importing CVS repositories
git-daemon.x86_64 : Git protocol dæmon
git-email.noarch : Git tools for sending email
git-gui.noarch : Git GUI tool
git-svn.noarch : Git tools for importing Subversion repositories
gitk.noarch : Git revision tree visualiser
gitweb.noarch : Simple web interface to git repositories
perl-Git.noarch : Perl interface to Git
cdparanoia.x86_64 : A Compact Disc Digital Audio (CDDA) extraction tool (or ripper).
dcraw.x86_64 : Tool for decoding raw image data from digital cameras
etckeeper.noarch : Store /etc in a SCM system (git, mercurial, bzr or darcs)
git.x86_64 : Fast Version Control System
icedax.x86_64 : A utility for sampling/copying .wav files from digital audio CDs
kacst-digital-fonts.noarch : Fonts for arabic from arabeyes project
libdc1394.i686 : 1394-based digital camera control library
libdc1394.x86_64 : 1394-based digital camera control library
libdlna.x86_64 : Implementation of Digital Living Network Alliance (DLNA) standards
libdv-tools.x86_64 : Basic tools to manipulate Digital Video streams
libgphoto2.i686 : Library for accessing digital cameras
libgphoto2.x86_64 : Library for accessing digital cameras
libptp2.x86_64 : Library to access digital cameras via PTP
perl-Audio-DSP.x86_64 : Interface to *NIX digital audio device
perl-Geo-Dymaxion.x86_64 : Plot latitude/longitude on a Fuller Dymaxion(tm) map
ptpcam.x86_64 : Command line utility to access digital cameras via PTP
python-Coherence.noarch : Python framework to participate in digital living networks
python-coherence.noarch : Python framework to participate in digital living networks
python-dulwich.x86_64 : Pure-Python implementation of Git file formats and protocols
tig.x86_64 : Text-mode interface for git
xmlsec1-devel.i686 : Libraries, includes, etc. to develop applications with XML Digital Signatures and XML Encryption support.
xmlsec1-devel.x86_64 : Libraries, includes, etc. to develop applications with XML Digital Signatures and XML Encryption support.
Name and summary matches only, use "search all" for everything.

You can get more info about a package using the following command:

[root@centospractice ~]# yum info htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.bytemark.co.uk
 * extras: mirrors.melbourne.co.uk
 * rpmforge: mirror.nl.leaseweb.net
 * updates: mirrors.coreix.net
Available Packages
Name : htop
Arch : x86_64
Version : 1.0.3
Release : 1.el6.rf
Size : 87 k
Repo : rpmforge
Summary : Interactive process viewer
URL : http://htop.sourceforge.net/
License : GPL
Description : htop is an interactive process viewer for Linux.

You can use yum list to view all available packages. I’d recommend you pipe it to less so you have pagination e.g. yum list | less.

Have a piece of software installed but you want to know what package it came from? No problem you can use yum provides:

[root@centospractice ~]# yum provides htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.melbourne.co.uk
* extras: mirrors.melbourne.co.uk
* rpmforge: mirror.nl.leaseweb.net
* updates: mirror.econdc.com
htop-1.0.2-1.el6.rf.x86_64 : Interactive process viewer
Repo : rpmforge

To display all your configured yum repositories whether enabled or disabled:

[root@centospractice ~]# yum repolist all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.melbourne.co.uk
 * extras: mirrors.melbourne.co.uk
 * rpmforge: archive.cs.uu.nl
 * updates: mirror.econdc.com
repo id repo name status
C6.0-base CentOS-6.0 - Base disabled
C6.0-centosplus CentOS-6.0 - CentOSPlus disabled
C6.0-contrib CentOS-6.0 - Contrib disabled
C6.0-extras CentOS-6.0 - Extras disabled
C6.0-updates CentOS-6.0 - Updates disabled
C6.1-base CentOS-6.1 - Base disabled
C6.1-centosplus CentOS-6.1 - CentOSPlus disabled
C6.1-contrib CentOS-6.1 - Contrib disabled
C6.1-extras CentOS-6.1 - Extras disabled
C6.1-updates CentOS-6.1 - Updates disabled
C6.2-base CentOS-6.2 - Base disabled
C6.2-centosplus CentOS-6.2 - CentOSPlus disabled
C6.2-contrib CentOS-6.2 - Contrib disabled
C6.2-extras CentOS-6.2 - Extras disabled
C6.2-updates CentOS-6.2 - Updates disabled
C6.3-base CentOS-6.3 - Base disabled
C6.3-centosplus CentOS-6.3 - CentOSPlus disabled
C6.3-contrib CentOS-6.3 - Contrib disabled
C6.3-extras CentOS-6.3 - Extras disabled
C6.3-updates CentOS-6.3 - Updates disabled
base CentOS-6 - Base enabled: 6,518
c6-media CentOS-6 - Media disabled
centosplus CentOS-6 - Plus disabled
contrib CentOS-6 - Contrib disabled
debug CentOS-6 - Debuginfo disabled
extras CentOS-6 - Extras enabled: 37
rpmforge RHEL 6 - RPMforge.net - dag enabled: 4,718
rpmforge-extras RHEL 6 - RPMforge.net - extras disabled
rpmforge-testing RHEL 6 - RPMforge.net - testing disabled
updates CentOS-6 - Updates enabled: 1,044
repolist: 12,317

To display just the enabled ones drop the all.

This concludes my article on software management. Check back tomorrow for my articles on other handy software and tools where I will be discussing some of the tools I use on a daily basis and find useful and bash shell scripting.

Subscribe to my feed either by E-mail or by RSS to receive updates as they happen.

Can you improve on any of the tips I’ve discussed here? If you can let me know in the comments.

Jason Edwards