YUM (Yellowdog Updater, Modified) is a client command lineapplication for updating an RPM based system from an internetrepository (YUM "yum-arch" server) accessible by URL (http://xxx, ftp://yyy or even file://zzz local or NFS).The YUM repository has a directory of the headers with RPM info and directory path information.YUM will resolve RPM package dependencies and manage the importation and installation of dependencies.
YUM is also capable of upgrading across releases.
YUM config file: /etc/yum.conf (Fedora Core 3)
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
retries=20
obsoletes=1
gpgcheck=1
exclude=firefox mozplugger gftp
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
- You may list packages you wish NOT to update (Space delimited list. '*' wildcards allowed.): exclude=package-name
- (i.e. On x86_64 I do not update firefox or mozplugger with the 64 bitversion, I use the 32 bit version so that 32 bit plugins will work.)
- Set "gpgcheck=0" to avoid the signature check.
For the option "gpgcheck=1" to work,use the "rpm --import GPG-KEY commands as detailed - above in section one of the RPM tutorial.
[root@server2 ~]# rpm --import /usr/share/rhn/RPM-GPG-KEY
[root@server2 ~]# rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora
[base]
name=Fedora Core $releasever - $basearch - Base
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
gpgcheck=1
Other protocols such as ftp can be used as well as http.
[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever
enabled=1
gpgcheck=1
Terms:
- releasever: Release Version - current version of Fedora.
- basearch: Base Architecture - system hardware architecture i.e. i386
- Fedora Extras:
Create file: /etc/yum.repos.d/extras.repo[extras]
name=Fedora Extras $releasever - $basearch
baseurl=http://mirrors.kernel.org/fedora/extras/$releasever/$basearch/
http://www.mirrorservice.org/sites/download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/
http://fr2.rpmfind.net/linux/fedora/extras/$releasever/$basearch/
gpgcheck=1- [root@server2 ~]# rpm --import http://download.fedora.redhat.com/pub/fedora/linux/extras/RPM-GPG-KEY-Fedora-Extras
- Add FreshRPM repository site to your list for downloads of non-standard Fedora software.
(Software not released by Red Hat like DVD players, audio encoders/rippers, etc)
Create file: /etc/yum.repos.d/freshrpms.repo[freshrpms]
name=Fedora Linux $releasever - $basearch - freshrpms
baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms
enabled=0
gpgcheck=1- [root@server2 ~]# rpm --importhttp://freshrpms.net/packages/builds/yum/RPM-GPG-KEY.freshrpms
- Add: dag.wieers.com
Create file: /etc/yum.repos.d/dag.repo[dag]
name=Dag APT Repository
baseurl=http://dag.freshrpms.net/fedora/$releasever/en/$basearch/dag/
http://dag.atrpms.net/fedora/$releasever/en/$basearch/dag/
http://ftp.heanet.ie/pub/freshrpms/pub/dag/fedora/$releasever/en/$basearch/dag/
enabled=0
gpgcheck=1 - Adding dag GPG signature key:
- [root@server2 ~]# rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
- Add: Macromedia.mplug.org
Create file: /etc/yum.repos.d/flash.repo[flash]
name=Macromedia Flash plugin
baseurl=http://macromedia.mplug.org/apt/fedora/$releasever
http://sluglug.ucsc.edu/macromedia/apt/fedora/$releasever
http://ruslug.rutgers.edu/macromedia/apt/fedora/$releasever
http://macromedia.rediris.es/apt/fedora/$releasever
enabled=0
#gpgcheck=1
- Fedora examples (more repositories: Jpackage, ...)
Registering Red Hat Enterprise Linux to enable YUM repository use:
Commands:
- rhn_register: GUI to enter user account and "Installation Number". Must purchase a license to get this.
- rhnreg_ks: Register a login/user account
Using YUM and YUM examples:
- Update:
- List packages which will be updated: yum check-update
(Does not perform an update) - Update all packages on your system: yum update
- Update a package: yum update package-name
- Update all with same prefix: yum update package-name-prefix\*
This command will update your system. It will interactively ask permission.i.e. "Is this ok [y/N]:" - To avoid the prompt/questions use the command: yum -y update Sample session:
# yum -y update
Setting up Update Process
Setting up Repos
base 100% |=========================| 1.1 kB 00:00
updates-released 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
base : ################################################## 2852/2852
primary.xml.gz 100% |=========================| 367 kB 00:02
MD Read : ################################################## 927/927
updates-re: ################################################## 927/927
Excluding Packages in global exclude list
Finished
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for mod_dav_svn to pack into transaction set.
mod_dav_svn-1.1.4-1.1.x86 100% |=========================| 8.9 kB 00:00
---> Package mod_dav_svn.x86_64 0:1.1.4-1.1 set to be updated
---> Downloading header for initscripts to pack into transaction set.
initscripts-7.93.7-1.x86_ 100% |=========================| 87 kB 00:00
---> Package initscripts.x86_64 0:7.93.7-1 set to be updated
---> Downloading header for gtk2 to pack into transaction set.
...
...
--> Running transaction check
Dependencies Resolved
Transaction Listing:
Install: aqhbci.x86_64 0:1.0.2beta-0.fc3 - updates-released
Install: aqhbci-devel.x86_64 0:1.0.2beta-0.fc3 - updates-released
Install: kernel.x86_64 0:2.6.11-1.14_FC3 - updates-released
...
...
Performing the following to resolve dependencies:
Install: aqbanking-devel.x86_64 0:1.0.4beta-0.fc3 - updates-released
Install: gwenhywfar-devel.x86_64 0:1.7.2-0.fc3 - updates-released
Total download size: 431 M
Downloading Packages:
(1/168): mod_dav_svn-1.1. 100% |=========================| 54 kB 00:00
(2/168): initscripts-7.93 100% |=========================| 1.1 MB 00:03
...
...
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating: libgcc 100 % done 1/333
Updating: libgcc 100 % done 2/333
...
...
Completing update for mod_dav_svn - 169/333
Completing update for initscripts - 170/333
Completing update for gtk2 - 171/333
...
...
Installed: aqhbci.x86_64 0:1.0.2beta-0.fc3 aqhbci-devel.x86_64 0:1.0.2beta-0.fc3 kernel.x86_64 0:2.6.11...
Dependency Installed: aqbanking-devel.x86_64 0:1.0.4beta-0.fc3 gwenhywfar-devel.x86_64 0:1.7.2-0.fc3
Updated: ImageMagick.i386 0:6.2.0.7-2.fc3 ImageMagick.x86_64 0:6.2.0.7-2.fc3 ImageMagick-c++.i386 ...
...
...
Obsoleted: openhbci.x86_64 0:0.9.17-1 openhbci.i386 0:0.9.17-1 openhbci-devel.x86_64 0:0.9.17-1
Complete!
#
Setting up Update Process
Setting up repositories
Reading repository metadata in from local files
Could not find update match for package-name
...
...
--> Finished Dependency Resolution
Error: Missing Dependency: package-name
- List packages which will be updated: yum check-update
- To install a single package: yum -y install package-name
This will also resolve package dependencies. - Remove a package: yum remove package-name
- Info:
- List available packages, version and state (base, installed, updates-released): yum list
- List the packages installed which are not available in repository listed in config file: yum list extras
- List packages which are obsoleted by packages in yum repository: yum list obsoletes
- Clean local cache of headers and RPM's: yum clean all
(See: /var/cache/yum/)
YUM Command Description yum -y install package-name
Install package. yum -y install package-name.arch
Install package of specified architecture. This is common when installing Firefox "i386" on a "x86_64" platform.
i.e.: yum -y install firefox.i386yum -y update package-name
yum -y update
yum -y --exclude=package-name updateUpdate package.
Update all packages on system for which updates are available.
Update all packages which have available updates excluding the specified package.yum remove package-name
yum remove package-name-1 package-name
yum remove package-name-2Remove package.
Remove packages.yum clean headers
yum clean cache
yum clean allRemove RPM header files.
Remove files from YUM cache: /var/cache/yum/
Clean up all YUM files left over from previous installations.yum list package-name
yum list regex
Listinformation about available packages from configured YUM repository.Will also list those which contain the specified regular expressionsearch pattern. yum list installed [regex-optional]
List installed packages. Same as rpm -qa yum list available [regex-optional]
List all available packages. yum check-update
Show which packages are available to be updated. yum search partial-package-name
List all packages which match the string specied in the package name or description. yum grouplist
yum groupinstall group-name
yum groupremove group-name
yum groupupdate group-name
List available package groups.
Install default packages in specified group.
Remove packages in group.
Update packages in group.rhn_register
Register to a Red Hat Network hosted server. Typically useful for licensed Red Hat Enterprise Linux.
- yum man page
- yum.conf man page
- You can set up your own YUM server for your own cluster or intranet. Set up a web server with the same paths as used in the configuration files and point your configuration files to your server. See YoLinux web server tutorial for configuration information.
- Fedora configures YUM as a daily cron job: /etc/cron.daily/yum.cron
#!/bin/sh
if [ -f /var/lock/subsys/yum ]; then
/usr/bin/yum -R 10 -e 0 -d 0 -y update yum
/usr/bin/yum -R 120 -e 0 -d 0 -y update
fi
- YUM Homepage
- YUM HowTo - YUM download, install and YUM server configuration.
- YUM header repository
YumEx: (Yum Extender) GUI interface to YUM commands and configuration
YumEx will allow you to manage the RPM packages on your system. It allowsthe administrator to install/update packages from internet repositoriesas well as un-install RPMs from the system.
THANKS :)
0 comments:
Post a Comment