Product SiteDocumentation Site

5.4.3. Plug-in Descriptions

The following list provides descriptions of a few useful Yum plug-ins:
fs-snapshot (yum-plugin-fs-snapshot)
The fs-snapshot plug-in extends Yum to create a snapshot of a file system before proceeding with a transaction such as a system update or package removal. When a user decides that the changes made by the transaction are unwanted, this mechanism allows the user to roll back to the changes that are stored in a snapshot.
In order for the plug-in to work, the root file system (that is, /) must be on an LVM (Logical Volume Manager) or Btrfs volume. To use the fs-snapshot plug-in on an LVM volume, take the following steps:
  1. Make sure that the volume group with the root file system has enough free extents. The required size is a function of the amount of changes to the original logical volume that is expected during the life of the snapshot. The reasonable default is 50–80 % of the original logical volume size.
    To display detailed information about a particular volume group, run the vgdisplay command in the following form as root:
    vgdisplay volume_group
    The number of free extents is listed on the Free PE / Size line.
  2. If the volume group with the root file system does not have enough free extents, add a new physical volume:
    1. As root, run the pvcreate command in the following form to initialize a physical volume for use with the Logical Volume Manager:
      pvcreate device
    2. Use the vgextend command in the following form as root to add the physical volume to the volume group:
      vgextend volume_group physical_volume
  3. Edit the configuration file located in /etc/yum/pluginconf.d/fs-snapshot.conf, and make the following changes to the [lvm] section:
    1. Change the value of the enabled option to 1:
      enabled = 1
    2. Remove the hash sign (that is, #) from the beginning of the lvcreate_size_args line, and adjust the number of logical extents to be allocated for a snapshot. For example, to allocate 80 % of the size of the original logical volume, use:
      lvcreate_size_args = -l 80%ORIGIN
    See Table 5.3, “Supported fs-snapshot.conf directives” for a complete list of available configuration options.
  4. Run the desired yum command, and make sure fs-snapshot is included in the list of loaded plug-ins (the Loaded plugins line) before you confirm the changes and proceed with the transaction. The fs-snapshot plug-in displays a line in the following form for each affected logical volume:
    fs-snapshot: snapshotting file_system (/dev/volume_group/logical_volume): logical_volume_yum_timestamp
  5. Verify that the system is working as expected:
    • If you decide to keep the changes, remove the snapshot by running the lvremove command as root:
      lvremove /dev/volume_group/logical_volume_yum_timestamp
    • If you decide to revert the changes and restore the file system to a state that is saved in a snapshot, take the following steps:
      1. As root, run the command in the following form to merge a snapshot into its original logical volume:
        lvconvert --merge /dev/volume_group/logical_volume_yum_timestamp
        The lvconvert command will inform you that a restart is required in order for the changes to take effect.
      2. Restart the system as instructed. You can do so by typing the following at a shell prompt as root:
        reboot
To use the fs-snapshot plug-in on a Btrfs file system, take the following steps:
  1. Run the desired yum command, and make sure fs-snapshot is included in the list of loaded plug-ins (the Loaded plugins line) before you confirm the changes and proceed with the transaction. The fs-snapshot plug-in displays a line in the following form for each affected file system:
    fs-snapshot: snapshotting file_system: file_system/yum_timestamp
  2. Verify that the system is working as expected:
    • If you decide to keep the changes, you can optionally remove unwanted snapshots. To remove a Btrfs snapshot, use the command in the following form as root:
      btrfs subvolume delete file_system/yum_timestamp
    • If you decide to revert the changes and restore a file system to a state that is saved in a snapshot, take the following steps:
      1. Determine the identifier of a particular snapshot by using the following command as root:
        btrfs subvolume list file_system
      2. As root, configure the system to mount this snapshot by default:
        btrfs subvolume set-default id file_system
      3. Restart the system. You can do so by typing the following at a shell prompt as root:
        reboot
For more information on logical volume management, Btrfs, and file system snapshots, see the Fedora 20 Storage Administration Guide. For additional information about the plug-in and its configuration, refer to the yum-fs-snapshot(1) and yum-fs-snapshot.conf(5) manual pages.

Table 5.3. Supported fs-snapshot.conf directives

Section Directive Description
[main] enabled=value Allows you to enable or disable the plug-in. The value must be either 1 (enabled), or 0 (disabled). When installed, the plug-in is enabled by default.
exclude=list Allows you to exclude certain file systems. The value must be a space-separated list of mount points you do not want to snapshot (for example, /srv /mnt/backup). This option is not included in the configuration file by default.
[lvm] enabled=value Allows you to enable or disable the use of the plug-in on LVM volumes. The value must be either 1 (enabled), or 0 (disabled). This option is disabled by default.
lvcreate_size_args=value Allows you to specify the size of a logical volume snapshot. The value must be the -l or -L command line option for the lvcreate utility followed by a valid argument (for example, -l 80%ORIGIN).
presto (yum-presto)
The presto plug-in adds support to Yum for downloading delta RPM packages, during updates, from repositories which have presto metadata enabled. Delta RPMs contain only the differences between the version of the package installed on the client requesting the RPM package and the updated version in the repository.
Downloading a delta RPM is much quicker than downloading the entire updated package, and can speed up updates considerably. Once the delta RPMs are downloaded, they must be rebuilt to apply the difference to the currently-installed package and thus create the full, updated package. This process takes CPU time on the installing machine. Using delta RPMs is therefore a tradeoff between time-to-download, which depends on the network connection, and time-to-rebuild, which is CPU-bound. Using the presto plug-in is recommended for fast machines and systems with slower network connections, while slower machines on very fast connections may benefit more from downloading normal RPM packages, that is, by disabling presto.
refresh-packagekit (PackageKit-yum-plugin)
The refresh-packagekit plug-in updates metadata for PackageKit whenever yum is run. The refresh-packagekit plug-in is installed by default.
rhnplugin (yum-rhn-plugin)
The rhnplugin provides support for connecting to RHN Classic. This allows systems registered with RHN Classic to update and install packages from this system.
See the rhnplugin(8) manual page for more information about the plug-in.
security (yum-plugin-security)
Discovering information about and applying security updates easily and often is important to all system administrators. For this reason Yum provides the security plug-in, which extends yum with a set of highly-useful security-related commands, subcommands and options.
You can check for security-related updates as follows:
~]# yum check-update --security
Loaded plugins: langpacks, presto, refresh-packagekit, security
Limiting package lists to security relevant ones
updates-testing/updateinfo                               | 329 kB     00:00
9 package(s) needed for security, out of 270 available

ConsoleKit.x86_64                    0.4.5-1.fc15                  updates
ConsoleKit-libs.x86_64               0.4.5-1.fc15                  updates
ConsoleKit-x11.x86_64                0.4.5-1.fc15                  updates
NetworkManager.x86_64                1:0.8.999-2.git20110509.fc15  updates
NetworkManager-glib.x86_64           1:0.8.999-2.git20110509.fc15  updates
[output truncated]
You can then use either yum update --security or yum update-minimal --security to update those packages which are affected by security advisories. Both of these commands update all packages on the system for which a security advisory has been issued. yum update-minimal --security updates them to the latest packages which were released as part of a security advisory, while yum update --security will update all packages affected by a security advisory to the latest version of that package available.
In other words, if:
  • the kernel-2.6.38.4-20 package is installed on your system;
  • the kernel-2.6.38.6-22 package was released as a security update;
  • then kernel-2.6.38.6-26 was released as a bug fix update,
...then yum update-minimal --security will update you to kernel-2.6.38.6-22, and yum update --security will update you to kernel-2.6.38.6-26. Conservative system administrators may want to use update-minimal to reduce the risk incurred by updating packages as much as possible.
See the yum-security(8) manual page for usage details and further explanation of the enhancements the security plug-in adds to yum.