Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:
 
 

How to use yum - Introduction

by Thomas Chung on Nov 9, 2003

Introduction - What is 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.

Reference: http://linux.duke.edu/projects/yum/

1. Before you use yum for the first time, type following command to download headers.

   # yum check-update

   It will take about 5 minutes to download a complete set of headers for base packages 
   for Fedora Core as well as any released updates for Fedora Core.

2. To install a package which is not installed already, use "install" option with yum.
   For example, ncftp is missing by default for workstation class.

   # yum install [package-name]

Example:
[root@localhost root]# yum install ncftp
Gathering header information file(s) from server(s)
Server: Fedora Core 1 - i386 - Base
Server: Fedora Core 1 - i386 - Released Updates
Finding updated packages
Downloading needed headers
Resolving dependencies
Dependencies resolved
I will do the following:
[install: ncftp 2:3.1.6-2.i386]
Is this ok [y/N]: y
Getting ncftp-3.1.6-2.i386.rpm
ncftp-3.1.6-2.i386.rpm    100% |=========================| 491 kB    00:04
Running test transaction:
Test transaction complete, Success!
ncftp 100 % done 1/1
Installed:  ncftp 2:3.1.6-2.i386
Transaction(s) Complete
[root@localhost root]#

3. To remove a package which installed already, use "remove" option with yum.

   # yum remove [package-name]

Example:
[root@localhost root]# yum remove ncftp
Gathering header information file(s) from server(s)
Server: Fedora Core 1 - i386 - Base
Server: Fedora Core 1 - i386 - Released Updates
Finding updated packages
Downloading needed headers
Resolving dependencies
Dependencies resolved
I will do the following:
[erase: ncftp 2:3.1.6-2.i386]
Is this ok [y/N]: y
Running test transaction:
Test transaction complete, Success!
Erasing: ncftp 1/1
Erased:  ncftp 2:3.1.6-2.i386
Transaction(s) Complete
[root@localhost root]#

4. To install any updates available, use "update" option with yum.

   # yum update

Example:
[root@localhost root]# yum update
Gathering header information file(s) from server(s)
Server: Fedora Core 1 - i386 - Base
Server: Fedora Core 1 - i386 - Released Updates
Finding updated packages
Downloading needed headers
No Packages Available for Update
No actions to take
[root@localhost root]#

5. To search a package by name (wildcard ok), use "search" option with yum.

   # yum search [any-name]

Example:
[root@localhost root]# yum search ??ftp
Gathering header information file(s) from server(s)
Server: Fedora Core 1 - i386 - Base
Server: Fedora Core 1 - i386 - Released Updates
Finding updated packages
Downloading needed headers
Looking in available packages for a providing package
Available package: vsftpd.i386 0:1.2.0-5 from base matches with
 vsftpd - Very Secure Ftp Daemon
Available package: vsftpd.i386 0:1.2.0-5 from base matches with
 vsftpd
2 results returned
Looking in installed packages for a providing package
Installed package: ncftp.i386 2:3.1.6-2 matches with
 ncftp
1 results returned
[root@localhost root]#

UPDATE: 2004-02-27 Thanks to Charles Curley, please read his excellent HOWTO Some Notes on yum Repositories at http://www.charlescurley.com/yum/