Docs/Drafts/SoftwareManagementGuide/YumPlugins

Yum Plugins
Author: RahulSundaram

Yum is easily extensible through plugins and a number of plugins have been written by many developers. These plugins advance the core capabilities of Yum and add more features. This section covers the plugins that are useful to Fedora users.

Installonlyn Plugin
Usually software package updates work by removing the older package, retaining the configuration and installing the newer version of a package. Kernel packages are more unique since newer versions can be installed in parallel. Every release of Fedora usually receives a number of kernel updates during its lifecycle due to the general policy of staying close to upstream projects. Each of these kernel updates then occupy space and over time will clutter the initial boot loader options. To prevent this, the installonlyn plugin leaves "n" number of kernel packages by default removing the oldest ones first sequentially on updates. Fedora Core 5 onwards installs this plugin by default. In Fedora, this plugin retains the current kernel and two latest updates. You can disable this plugin or configure it to retain a different number of kernels by setting the value in the file /etc/yum/pluginconf.d/installonlyn.conf

Fastest Mirror Plugin
Yum in Fedora uses a dynamic server side mirror management infrastructure that distributes the bandwidth consumptions on each of these mirrors by automatically directing the update to one of the geographically closest mirrors. This mirror is automatically checked against the master server for consistency.

The fastest mirror plugin enhances the speed of updates by maintaining a local offline hostfile cache of the speed of the mirrors. It sorts the mirror list by speed and prioritizes the faster ones for package downloads. This plugin is not installed by default. For installing it, use the following command or from the Applications menu use ''Add/Remove Software".

su -c 'yum install yum-fastestmirror'

You can configure various settings of this plugin in the file /etc/yum/pluginconf.d/fastestmirror.conf

Downloadonly Plugin
FIXME: Figure out how plugin works and document that.

Changelog Plugin
When Fedora developers provide a update to a existing package, they describe the changes in the new update in the software package change log. This plugin helps you see the package changelog before doing a update. This plugin is not installed by default. For installing it, use the following command or from the Applications menu use ''Add/Remove Software".

su -c 'yum install yum-changelog'

Sample output:

su -c 'yum update frysk --changelog' Loading "changelog" plugin Setting up Update Process Setting up repositories Reading repository metadata in from local files Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Package frysk.i686 0:0.0.1.2006.12.01.rh1-1.fc6 set to be updated --> Running transaction check

Changes in packages about to be updated:

frysk - 0.0.1.2006.12.01.rh1-1.fc6.i686 - New upstream version. - Resolves: #211288.
 * Sat Dec 2 03:30:00 2006 Stepan Kasal  - 0.0.1.2006.12.01.rh1-1

- New upstream version. - The stamp file for glade files has been renamed.
 * Fri Dec 1 03:30:00 2006 Stepan Kasal  - 0.0.1.2006.11.30.rh1-1

Dependencies Resolved

=
================================================================ Package                Arch       Version          Repository        Size

=
================================================================ Updating: frysk                  i686       0.0.1.2006.12.01.rh1-1.fc6  updates           7.5 M

Transaction Summary

=
================================================================ Install     0 Package(s) Update      1 Package(s) Remove      0 Package(s)

Total download size: 7.5 M Is this ok [y/N] :

By default, the package changelog is showed before doing an update. If you prefer to see the changelog after doing an update instead, you can change the setting from when=pre to when=post in the file /etc/yum/pluginconf.d/changelog.conf. A sample output after the configuration has been changed from 'pre' to 'post'

su -c 'yum update frysk --changelog' Loading "changelog" plugin Setting up Update Process Setting up repositories Reading repository metadata in from local files Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Package frysk.i686 0:0.0.1.2006.12.01.rh1-1.fc6 set to be updated --> Running transaction check

Dependencies Resolved

=
================================================================ Package                Arch       Version          Repository        Size

=
================================================================ Updating: frysk                  i686       0.0.1.2006.12.01.rh1-1.fc6  updates           7.5 M

Transaction Summary

=
================================================================ Install     0 Package(s) Update      1 Package(s) Remove      0 Package(s)

Total download size: 7.5 M Is this ok [y/N] : y Downloading Packages: (1/1): frysk-0.0.1.2006.1 100% |=========================| 7.5 MB   04:24 Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Updating : frysk                        ######################### [1/2] Cleanup  : frysk                        ######################### [2/2]

Changes in updated packages:

frysk - 0.0.1.2006.12.01.rh1-1.fc6.i686 - New upstream version. - Resolves: #211288.
 * Sat Dec 2 03:30:00 2006 Stepan Kasal  - 0.0.1.2006.12.01.rh1-1

- New upstream version. - The stamp file for glade files has been renamed.
 * Fri Dec 1 03:30:00 2006 Stepan Kasal  - 0.0.1.2006.11.30.rh1-1

Updated: frysk.i686 0:0.0.1.2006.12.01.rh1-1.fc6 Complete!

Skip-broken Plugin
Yum by default checks to make all dependencies are resolved before doing a update, however on occasions like when testing the Fedora development tree or when there is a known dependency issue in the software repository it is useful to skip the broken dependencies automatically instead of having to manually specify the exact packages to ignore in the command line or yum configuration file. The skip-broken plugin helps do that. This plugin is not installed by default. For installing it, use the following command or from the Applications menu use ''Add/Remove Software".

su -c 'yum install yum-skip-broken'

You can use this plugin doing a update by specifying the following command line argument.

su -c 'yum update -ignore-broken'

You can disable this plugin by changing the option in the file /etc/yum/pluginconf.d/skip-broken.conf

Allowdowngrade Plugin
The core Yum package manager does not have the functionality to let users downgrade a package. This is a design choice to favor robustness over the additional functionality. Unlike package updates, downgrades are not tested usually and hence may not have the desired effect. However advanced users would still find this feature useful to recover out of a broken update. This plugin adds the ability to perform downgrades of packages in Fedora. This plugin is not installed by default. For installing it, use the following command or from the Applications menu use ''Add/Remove Software".

su -c 'yum install yum-allowdowngrade'

You can use this plugin doing a update by specifying the following command line argument.

su -c 'yum update -allow-downgrade'

You can disable this plugin by changing the option in the file /etc/yum/pluginconf.d/allowdowngrade.conf

Disabling All Plugins
If you would like to disable all the plugins while running Yum, you can use the following command line argument

su -c 'yum update --noplugins

Developing New Plugins
If you are interested in developing your own plugins to add new features or change the behavior of Yum, refer to the guidelines at http://wiki.linux.duke.edu/WritingYumPlugins. Join the yum development list at https://lists.dulug.duke.edu/mailman/listinfo/yum-devel to collaborate with Yum developers.