By GufyMike at 2004-06-04 12:33
My name is Mike and I use Fedora Core 2 as my main OS at home and for work, I also use RH9 at work, along with FreeBSD. When updating or installing software on the RH9 and FreeBSD, I do it remotely, for the most part all the software I need is on the default install of the distro I'm using, but occasionally (especially for my home PC) I need to install some applications not included on the Distro CDs. For example mp3 support for FC2.
For you apt or apt-get users, yum is just as powerful as apt. I like it because its included with the RH and FC Distros and there is no need to download another application to do the same thing. I will say this the only thing that I have found out apt has and yum doesn't is a GUI. I will address that at the end.
Now the only option/switch I use every time I use yum is -y. -y will tell yum to say yes to all questions.
First off yum use a file (/etc/yum.conf) to keep track of repositories to search for applications. The default yum.conf has only 2 or 3 repositories for updating its distro. For Example FC2 has these default entries:
I add these entries to those:
name=Fedora Linux $releasever - $basearch - core
name=Fedora Linux $releasever - $basearch - updates
name=Fedora Linux $releasever - $basearch - freshrpms
#name=Fedora Linux $releasever - $basearch - testing updates
Those extra repositories act as a backup to my default ones if those servers aren't available and also contain applications not available with the distro. Also they will have an entry for your distro (if applicable) to add to your yum.conf listed on their sites.
name=Livna.org Fedora Compatible Packages (stable)
name=Fedora US $releasever - $basearch - Latest Packages
name=Fedora Core 2 NewRPMS.sunsite.dk
name=Dag RPM Repository for Fedora Core 2
name=Extra Fedora rpms dries - $releasever - $basearch
Once those are added to your yum.conf you can now update the headers for your distro by entering:
That will only download headers for new updates or software available. If you haven't ran yum check-update yet it will take a bit depending on the amount of headers needed to download.
yum -y check-update
This command will not only update the headers but also download and install any updates available:
You can also specify a specific package to update by typing:
after updating the one command (besides installing a package) i continuously us is:
yum -y update <package name>
That will display a list of packages available for install. I usually redirect the output using the (>) redirection operator.
If I want to see whats installed on my system, this is the command I use.
yum -y list > packageslist
To install a new package I first use the list option to see whats available and then type:
yum -y list installed
Working example: yum -y install mplayer will download and install mplayer. Whats nice about yum and apt is that they will resolve dependencies. If you don't have a dependency and its available in your list of repositories yum will download it and install it for you automatically. If its not available then you will have to search for it and install it manually first then continue with yum.
yum -y install <package name>
If you now a packages name and want to know if its available with out searching through the list?
This will search your repositories for a matching package.
yum -y search <package name>
This will provide you with a full detail and summary on a package.
yum -y info package name
To remove or uninstall a package:
OK yum will download the packages but will not delete them after install/upgrade and will not delete old headers.
yum -y remove ,package name>
I hope this heps some of you when installing /updating your software. There are a few more options that yum provides (for the most part variations of ones stated here.) by typing:
That will give you the man page on yum with more options. now IU haven't had a problem installing anything or updating except when a dependency hasn't been packaged yet. For example to update to php 188.8.131.52 I need to remove some php-* because they aren't available yet and require 184.108.40.206
Example php-mmcache needs 220.127.116.11 and not compatible with 18.104.22.168
So I'll wait. Now one last little thing if you want to install more than package using yum -y install. You CAN.
This will download and install mplayer, boson, and cssed in one shot:
I have a small bash script for yum and rpm (RPM queries are used to supplement yums). yummenu contains all the commands I have included here and some more. It will download and install yum and RPM from sources if you can't have them available and has the yum.conf I use for FC2 and RH9
yum -y install mplayer boson cssed
Any questions, contribs, corrections go ahead and let me know.