Friday, 20 May 2011

Basic Linux commands – Part II. Installing / Uninstalling software

This page is about YUM (Yellowdog Updater, Modified), the RPM package installer.
I thought of writing one for Apt (apt-get), which is what you would use if your distribution would be Debian / Ubuntu instead of Red Hat / CentOS, and maybe even others but since this is not rocket science and the information is available everywhere anyway, that other pages are postponed indefinitely :)

install command –  Install a package
yum install mc
This will install Midnight Commander.
yum install httpd php53 php53-devel
This will install all three packages giving you a basic Apache HTTP Server with PHP in seconds.

erase command –  Uninstall a package
yum erase mc
This will uninstall Midnight Commander, but that’s unacceptable so reinstall it :)

search command –  Uninstall a package
yum search php53
Displays all PHP 5.3 packages available.

update command –  Update a package
yum update
Displays all packages that have newer versions available and allows you to update all of them.
yum update mysql
Displays MySQL packages that have newer versions available and allows you to update them.
You could run yum update from time to time to see what updates are available for you and then update just want you want with yum update myPackage.

Add repository
You need to add repositories when the default ones don’t include the packages you want (some famous packages not included by default at the time of writing this post are ClamAV and Pure-FTPd). Don’t add repositories before you try yum install myPackage and YUM can’t find it.
cd /etc/yum.repos.d/
This command will change the working directory to YUM’s.
This would download a repository containing ClamAV.
This would download a repository containing Pure-FTPd.

You can do more with YUM but this should be enough for now :)

One more thing. Just to make sure everything is 100% correct on this site, YUM is not actually a Linux command, it's a software. Forget about this paragraph... Now!

The next post will be about Managing Users and Groups.

No comments:

Post a Comment