| Deployment GuideRed Hat provides PackageKit for viewing, managing, updating, installing and uninstalling packages compatible with your system. PackageKit consists of several graphical interfaces that can be opened from the GNOME panel menu, or from the Notification Area when PackageKit alerts you that updates are available. For more information on PackageKit's architecture and available front ends, refer to Section 7.3, "PackageKit Architecture". 7.1. Updating Packages with Software UpdatePackageKit displays a starburst icon in the Notification Area whenever updates are available to be installed on your system. Clicking on the notification icon opens the Software Update window. Alternatively, you can open Software Updates by clicking ⤍ ⤍ from the GNOME panel, or running the gpk-update-viewer command at the shell prompt. In the Software Updates window, all available updates are listed along with the names of the packages being updated (minus the .rpm suffix, but including the CPU architecture), a short summary of the package, and, usually, short descriptions of the changes the update provides. Any updates you do not wish to install can be de-selected here by unchecking the checkbox corresponding to the update. The updates presented in the Software Updates window only represent the currently-installed packages on your system for which updates are available; dependencies of those packages, whether they are existing packages on your system or new ones, are not shown until you click Install Updates. PackageKit utilizes the fine-grained user authentication capabilities provided by the PolicyKit toolkit whenever you request it to make changes to the system. Whenever you instruct PackageKit to update, install or remove packages, you will be prompted to enter the superuser password before changes are made to the system. If you instruct PackageKit to update the kernel package, then it will prompt you after installation, asking you whether you want to reboot the system and thereby boot into the newly-installed kernel. Setting the Update-Checking Interval Right-clicking on PackageKit's Notification Area icon and clicking opens the Software Update Preferences window, where you can define the interval at which PackageKit checks for package updates, as well as whether or not to automatically install all updates or only security updates. Leaving the Check for updates when using mobile broadband box unchecked is handy for avoiding extraneous bandwidth usage when using a wireless connection on which you are charged for the amount of data you download. 7.2. Using Add/Remove SoftwareTo find and install a new package, on the GNOME panel click on ⤍ ⤍ , or run the gpk-application command at the shell prompt. 7.2.1. Refreshing Software Sources (Yum Repositories)PackageKit refers to Yum repositories as software sources. It obtains all packages from enabled software sources. You can view the list of all configured and unfiltered (see below) Yum repositories by opening Add/Remove Software and clicking ⤍ . The Software Sources dialog shows the repository name, as written on the name=<My Repository Name> field of all [repository ] sections in the /etc/yum.conf configuration file, and in all repository .repo files in the /etc/yum.repos.d/ directory. Entries which are checked in the Enabled column indicate that the corresponding repository will be used to locate packages to satisfy all update and installation requests (including dependency resolution). You can enable or disable any of the listed Yum repositories by selecting or clearing the checkbox. Note that doing so causes PolicyKit to prompt you for superuser authentication. The Enabled column corresponds to the enabled=<1 or 0> field in [repository ] sections. When you click the checkbox, PackageKit inserts the enabled=<1 or 0> line into the correct [repository ] section if it does not exist, or changes the value if it does. This means that enabling or disabling a repository through the Software Sources window causes that change to persist after closing the window or rebooting the system. Note that it is not possible to add or remove Yum repositories through PackageKit. Checking the box at the bottom of the Software Sources window causes PackageKit to display source RPM, testing and debuginfo repositories as well. This box is unchecked by default. After making a change to the available Yum repositories, click on ⤍ to make sure your package list is up-to-date. 7.2.2. Finding Packages with FiltersOnce the software sources have been updated, it is often beneficial to apply some filters so that PackageKit retrieves the results of our Find queries faster. This is especially helpful when performing many package searches. Four of the filters in the drop-down menu are used to split results by matching or not matching a single criterion. By default when PackageKit starts, these filters are all unapplied (No filter), but once you do filter by one of them, that filter remains set until you either change it or close PackageKit. Because you are usually searching for available packages that are not installed on the system, click ⤍ and select the radio button. Also, unless you require development files such as C header files, click ⤍ and select the radio button. This filters out all of the <package_name> -devel packages we are not interested in. The two remaining filters with submenus are: -
Narrows the search to either applications which provide a GUI interface (Only graphical) or those that do not. This filter is useful when browsing for GUI applications that perform a specific function. -
Search for packages which are considered to be free software. Refer to the Fedora Licensing List for details on approved licenses.
The remaining filters can be enabled by selecting the checkboxes next to them: Checking the checkbox filters out generally-uninteresting packages that are typically only dependencies of other packages that we want. For example, checking and searching for <package> would cause the following related packages to be filtered out of the Find results (if it exists): <package> -devel
<package> -libs
<package> -libs-devel
<package> -debuginfo
Checking filters out all older versions of the same package from the list of results, which is generally what we want. Note that this filter is often combined with the filter to search for the latest available versions of new (not installed) packages. - Only native packages
Checking the box on a multilib system causes PackageKit to omit listing results for packages compiled for the architecture that runs in compatibility mode. For example, enabling this filter on a 64-bit system with an AMD64 CPU would cause all packages built for the 32-bit x86 CPU architecture not to be shown in the list of results, even though those packages are able to run on an AMD64 machine. Packages which are architecture-agnostic (i.e. noarch packages such as crontabs-1.10-32.1.el6.noarch.rpm ) are never filtered out by checking . This filter has no affect on non-multilib systems, such as x86 machines.
7.2.3. Installing and Removing Packages (and Dependencies)With the two filters selected, Only available and Only end user files, search for the screen window manager for the command line and highlight the package. You now have access to some very useful information about it, including: a clickable link to the project homepage; the Yum package group it is found in, if any; the license of the package; a pointer to the GNOME menu location from where the application can be opened, if applicable; and the size of the package, which is relevant when we download and install it. When the checkbox next to a package or group is checked, then that item is already installed on the system. Checking an unchecked box causes it to be marked for installation, which only occurs when the Apply button is clicked. In this way, you can search for and select multiple packages or package groups before performing the actual installation transactions. Additionally, you can remove installed packages by unchecking the checked box, and the removal will occur along with any pending installations when Apply is pressed. Dependency resolution, which may add additional packages to be installed or removed, is performed after pressing Apply. PackageKit will then display a window listing those additional packages to install or remove, and ask for confirmation to proceed. Select screen and click the Apply button. You will then be prompted for the superuser password; enter it, and PackageKit will install screen. After finishing the installation, PackageKit sometimes presents you with a list of your newly-installed applications and offers you the choice of running them immediately. Alternatively, you will remember that finding a package and selecting it in the Add/Remove Software window shows you the Location of where in the GNOME menus its application shortcut is located, which is helpful when you want to run it. Once it is installed, you can run screen , a screen manager that allows you to have multiple logins on one terminal, by typing screen at a shell prompt. screen is a very useful utility, but we decide that we do not need it and we want to uninstall it. Remembering that we need to change the Only available filter we recently used to install it to Only installed in ⤍ , we search for screen again and uncheck it. The program did not install any dependencies of its own; if it had, those would be automatically removed as well, as long as they were not also dependencies of any other packages still installed on our system. Although PackageKit automatically resolves dependencies during package installation and removal, it is unable to remove a package without also removing packages which depend on it. This type of operation can only be performed by RPM, is not advised, and can potentially leave your system in a non-functioning state or cause applications to behave erratically and/or crash. 7.2.4. Installing and Removing Package GroupsPackageKit also has the ability to install Yum package groups, which it calls Package collections. Clicking on Package collections in the top-left list of categories in the Software Updates window allows us to scroll through and find the package group we want to install. In this case, we want to install Czech language support (the Czech Support group). Checking the box and clicking apply informs us how many additional packages must be installed in order to fulfill the dependencies of the package group. Similarly, installed package groups can be uninstalled by selecting Package collections, unchecking the appropriate checkbox, and applying. 7.2.5. Viewing the Transaction LogPackageKit maintains a log of the transactions that it performs. To view the log, from the Add/Remove Software window, click ⤍ , or run the gpk-log command at the shell prompt. The Software Log Viewer shows the following information: Date - the date on which the transaction was performed. Action - the action that was performed during the transaction, for example Updated packages or Installed packages. Details - the transaction type such as Updated, Installed, or Removed, followed by a list of affected packages. Username - the name of the user who performed the action. Application - the front end application that was used to perform the action, for example Update System.
Typing the name of a package in the top text entry field filters the list of transactions to those which affected that package. 7.3. PackageKit ArchitectureRed Hat provides the PackageKit suite of applications for viewing, updating, installing and uninstalling packages and package groups compatible with your system. Architecturally, PackageKit consists of several graphical front ends that communicate with the packagekitd daemon back end, which communicates with a package manager-specific back end that utilizes Yum to perform the actual transactions, such as installing and removing packages, etc. Table 7.1. PackageKit GUI windows, menu locations, and shell prompt commands Window Title | Function | How to Open | Shell Command |
---|
Add/Remove Software | Install, remove or view package info | From the GNOME panel: ⤍ ⤍ | gpk-application | Software Update | Perform package updates | From the GNOME panel: ⤍ ⤍ | gpk-update-viewer | Software Sources | Enable and disable Yum repositories | From Add/Remove Software: ⤍ | gpk-repo | Software Log Viewer | View the transaction log | From Add/Remove Software: ⤍ | gpk-log | Software Update Preferences | Set PackageKit preferences | | gpk-prefs | (Notification Area Alert) | Alerts you when updates are available | From the GNOME panel: ⤍ ⤍ , the Startup Programs tab | gpk-update-icon |
The packagekitd daemon runs outside the user session and communicates with the various graphical front ends. The packagekitd daemon communicates via the DBus system message bus with another back end, which utilizes Yum's Python API to perform queries and make changes to the system. On Linux systems other than Red Hat and Fedora, packagekitd can communicate with other back ends that are able to utilize the native package manager for that system. This modular architecture provides the abstraction necessary for the graphical interfaces to work with many different package managers to perform essentially the same types of package management tasks. Learning how to use the PackageKit front ends means that you can use the same familiar graphical interface across many different Linux distributions, even when they utilize a native package manager other than Yum. In addition, PackageKit's separation of concerns provides reliability in that a crash of one of the GUI windows-or even the user's X Window session-will not affect any package management tasks being supervised by the packagekitd daemon, which runs outside of the user session. All of the front end graphical applications discussed in this chapter are provided by the gnome-packagekit package instead of by PackageKit and its dependencies. Finally, PackageKit also comes with a console-based front end called pkcon . 7.4. Additional Resources |
| |