Login to PAWS
Baton Rouge, Louisiana | Sunday, November 22, 2009

Fedora at LSU - yum

[Linux]   [RHN]   [Redhat]   [Fedora]   [Fedora Legacy]   [Ubuntu/Kubuntu]   [SUSE]   [OpenSUSE]   [Gentoo]   [Knoppix]   [Debian]   [CentOS]   [Mandriva]   

 This website brought to you by:
 Louisiana State University
 Information Technology Services
 High Performance Computing
 Louisiana Opitcal Network Initiative

 Mission Statement
 Printable

 Releases:
   Core 1
   Core 2
   Core 3
   Core 4
   Core 5
   Core 6
   Core 7
   Core 8
   Core 9
   Core 10
   Core 11
 
 Updates:
   Core 1
   Core 2
   Core 3
   Core 4
   Core 5
   Core 6
   Core 7
   Core 8
   Core 9
   Core 10
   Core 11

 Extras:
 
 Manuals
 How to Install Fedora
 How to Update Fedora
 E-Mail Notification

 

yum (yellowdog updater, modified) has been developed by Duke University. Here is their definition of yum:

Yum is an automatic updater and package installer/remover for rpm systems. It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm.

yum is an excellent tool for updating, installing, and removing packages from a system. To use yum, you must install the yum client and then make sure it is properly configured.


yum Information


yum Commands (Briefly)

  • yum - display brief help
  • yum check-update - update headers and display any updates the current system needs
  • yum update - check for updates and apply them interactively
  • yum -y update - check for updates and apply them with
  • yum update <package> - check for updates and upgrade the specified package(s) only
  • yum info - similar output to a rpm -qai
  • yum info <package> - information about a specific package
  • yum list - lists all available packages
  • yum list <package> - list individual package(s)
  • yum list installed - list all installed packages
  • yum list available - list all packages not installed
  • yum list update - list all packages that need to be upgraded
  • yum list extras - list all installed packages that are not available from any of the defined yum resources (defined in the /etc/yum.conf file)
  • yum clean - delete any rpms in the yum cache and remove any unneeded headers
  • yum install <package> - install the package
  • yum remove <package> - delete the package
  • yum provides <file> - find out what package provides a particuar file
  • yum search <string> - searches for packages containing the string in their name or header info


yum Installation

yum comes preloaded on every Fedora Core since Core 1; however, with Fedora Core 3 the /etc/yum.repos.d directory was introduced. yum.repos.d allows for individual configuration files for each repository that yum looks at for rpms instead of having to edit the yum.conf file.

LSU hosts .repo files for the main fedora repositoies and a number of third-party repositories. Our repo files have been edited to first look for your rpm on our servers. We mirror thousands of rpms here at LSU and recommend that you use our resources first to save you time and us bandwidth.

Lets look at LSU's fedora-core.repo:

[core]
name=Fedora Core $releasever - $basearch
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
baseurl=http://ibiblio.lsu.edu/dist/fedora/core/$releasever/$basearch/os/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=core-$releasever&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
priority=1

As you can see we have changed the base url to one of our mirror servers. Also on the third-party repos we have modified the priority flag so that during an yum update they do not overwrite fedora-core rpms. The mirrorlist allows for a set of fallback servers for yum if LSU's servers are not available.

Installation of these repo files is rather simple. Lets check it out:
If you are using Core 7, get the files in the 7 directory instead

# cd /etc/yum.repos
# wget http://fedora.lsu.edu/yum/freshrpms.repo
# wget http://fedora.lsu.edu/yum/fedora-updates.repo
# wget http://fedora.lsu.edu/yum/alt
# wget http://fedora.lsu.edu/yum/fedora-legacy.repo
# wget http://fedora.lsu.edu/yum/fedora-updates-testing.repo
# wget http://fedora.lsu.edu/yum/7
# wget http://fedora.lsu.edu/yum/fedora-extras.repo
# wget http://fedora.lsu.edu/yum/fedora-core.repo
# wget http://fedora.lsu.edu/yum/livna.repo
# wget http://fedora.lsu.edu/yum/dries.repo
# wget http://fedora.lsu.edu/yum/keys
# wget http://fedora.lsu.edu/yum/

The directory we are pulling from is http://ibiblio.lsu.edu/dist/fedora/yum/.

Each wget commnad will download each repo to the current directory you are in, which is /etc/yum.repos.d

These files are also linked below under yum downloads.

Also, we have to copy the GPG key files for livna and freshrpms.

# cd /etc/pki/rpm-gpg/
# wget http://fedora.lsu.edu/yum/keys/RPM-GPG-KEY-freshrpms
# wget http://fedora.lsu.edu/yum/keys/RPM-GPG-KEY-livna
# wget http://fedora.lsu.edu/yum/keys/


Using yum

yum works by caching copies of the dependency rules for rpms. The first time you run yum, it downloads a copy of these files to /var/cache/yum (this will occupy from 1 to 20 MB of disk). After that, it only downloads new updates.

You should do a check-update after you install yum:

# yum check-update
Loading "installonlyn" plugin
Setting up repositories
livna                                                                [1/5]
livna                     100% |=========================|  951 B    00:00
core                                                                 [2/5]
core                      100% |=========================| 1.1 kB    00:00
updates                                                              [3/5]
updates                   100% |=========================| 1.2 kB    00:00
freshrpms                                                            [4/5]
freshrpms                 100% |=========================|  951 B    00:00
extras                                                               [5/5]
extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 1.9 MB    00:01
extras    : ################################################## 6191/6191
Added 19 new packages, deleted 24 old in 33.13 seconds
#
If there are any headers to download (there will be the first time), they will be listed in the output. If your system needs updating, the output will look more like this:
# yum check-update
Loading "installonlyn" plugin
Setting up repositories
livna                                                                [1/5]
livna                     100% |=========================|  951 B    00:00
core                                                                 [2/5]
core                      100% |=========================| 1.1 kB    00:00
updates                                                              [3/5]
updates                   100% |=========================| 1.2 kB    00:00
freshrpms                                                            [4/5]
freshrpms                 100% |=========================|  951 B    00:00
extras                                                               [5/5]
extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 1.9 MB    00:01
extras    : ################################################## 6191/6191
Added 19 new packages, deleted 24 old in 33.13 seconds

authconfig.i386                          5.2.3-1                updates
avahi.i386                               0.6.11-3.fc5           updates
avahi-glib.i386                          0.6.11-3.fc5           updates
bash.i386                                3.1-9.fc5.1            updates
beagle.i386                              0.2.6-1.fc5.1          updates
bind.i386                                30:9.3.3-0.2.rc2.fc5   updates
gnome-applets.i386                       1:2.14.3-2.fc5         updates
#

You can do an actual update by typing yum update. The only difference is that the line Is this ok [y/N]: will follow the list of updates that available. If you type y, yum will check download the necesary rpms to /var/cache/yum and then it will apply them to the system. if you answer n, then nothing will be done.

After doing updates, you probably want to do a yum clean to remove the cached copies of the newly installed rpms.


yum downloads




Official web site of Louisiana State University. Copyright © 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009


[ Powered by Linux ]      [ Powered by Apache ]      [ Powered by PHP ]