Cari di RHE Linux 
    RHE Linux User Manual
Daftar Isi
(Sebelumnya) 13 : Chapter 6. Yum - Deployme ...13 : Part III. Networking - De ... (Berikutnya)

Deployment Guide

Chapter 7. PackageKit

Red 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 Update

PackageKit displays a starburst icon in the Notification Area whenever updates are available to be installed on your system.
PackageKit's icon in the Notification Area
PackageKit's icon in the Notification Area.

Figure 7.1. PackageKit's icon in the Notification Area


Clicking on the notification icon opens the Software Update window. Alternatively, you can open Software Updates by clicking SystemAdministrationSoftware Update 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.
Installing updates with Software Update
Installing updates with PackageKit's Software Update window.

Figure 7.2. Installing updates with Software 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 Preferences 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.
Setting PackageKit's update-checking interval
Setting the update-checking interval for packagekit by right-clicking on the notification area applet.

Figure 7.3. Setting PackageKit's update-checking interval


7.2. Using Add/Remove Software

To find and install a new package, on the GNOME panel click on SystemAdministrationAdd/Remove Software, or run the gpk-application command at the shell prompt.
PackageKit's Add/Remove Software window
Viewing PackageKit's Add/Remove Software window.

Figure 7.4. PackageKit's Add/Remove Software window


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 SystemSoftware sources. 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.

Showing source RPM, test and debuginfo repositories

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 SystemRefresh package lists to make sure your package list is up-to-date.

7.2.2. Finding Packages with Filters

Once 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 Filters 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 FiltersInstalled and select the Only available radio button.
Filtering out already-installed packages
Filtering out packages which are already installed.

Figure 7.5. Filtering out already-installed packages


Also, unless you require development files such as C header files, click FiltersDevelopment and select the Only end user files radio button. This filters out all of the <package_name>-devel packages we are not interested in.
Filtering out development packages from the list of Find results
Filtering out development packages from our results.

Figure 7.6. Filtering out development packages from the list of Find results


The two remaining filters with submenus are:
Graphical
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.
Free
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:
Hide subpackages
Checking the Hide subpackages checkbox filters out generally-uninteresting packages that are typically only dependencies of other packages that we want. For example, checking Hide subpackages 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
Only newest packages
Checking Only newest packages 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 Only available filter to search for the latest available versions of new (not installed) packages.
Only native packages
Checking the Only native packages 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 Only native packages. 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.
Viewing and installing a package with PackageKit's Add/Remove Software window
Viewing and installing a package with PackageKit's Add/Remove Software window.

Figure 7.7. Viewing and installing a package with PackageKit's Add/Remove Software window


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 FiltersInstalled, 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.

Removing a package when other packages depend on it

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.
Removing a package with PackageKit's Add/Remove Software window
Removing a package with PackageKit's Add/Remove Software window.

Figure 7.8. Removing a package with PackageKit's Add/Remove Software window


7.2.4. Installing and Removing Package Groups

PackageKit 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.
Installing the Czech Support package group
Install Czech language support with PackageKit's Add/Remove Software window.

Figure 7.9. Installing the Czech Support 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 Log

PackageKit maintains a log of the transactions that it performs. To view the log, from the Add/Remove Software window, click SystemSoftware log, 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.
Viewing the log of package management transactions with the Software Log Viewer
Viewing the log of package management transactions with PackageKit's Software Log viewer window.

Figure 7.10. Viewing the log of package management transactions with the Software Log Viewer


7.3. PackageKit Architecture

Red 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" shows the name of the GUI window, how to start the window from the GNOME desktop or from the Add/Remove Software window, and the name of the command line application that opens that window.

Table 7.1. PackageKit GUI windows, menu locations, and shell prompt commands

Window TitleFunctionHow to OpenShell Command
Add/Remove SoftwareInstall, remove or view package info
From the GNOME panel: SystemAdministrationAdd/Remove Software
gpk-application
Software UpdatePerform package updates
From the GNOME panel: SystemAdministrationSoftware Update
gpk-update-viewer
Software SourcesEnable and disable Yum repositories
From Add/Remove Software: SystemSoftware Sources
gpk-repo
Software Log ViewerView the transaction log
From Add/Remove Software: SystemSoftware Log
gpk-log
Software Update PreferencesSet PackageKit preferencesgpk-prefs
(Notification Area Alert)Alerts you when updates are available
From the GNOME panel: SystemPreferencesStartup Applications, 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[3] 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

PackageKit home page - http://www.packagekit.org/index.html
Information about and mailing lists for PackageKit.
PackageKit FAQ - http://www.packagekit.org/pk-faq.html
An informative list of Frequently Asked Questions for the PackageKit software suite.
PackageKit Feature Matrix - http://www.packagekit.org/pk-matrix.html
Cross-reference PackageKit-provided features with the long list of package manager back ends.


[3] System daemons are typically long-running processes that provide services to the user or to other programs, and which are started, often at boot time, by special initialization scripts (often shortened to init scripts). Daemons respond to the service command and can be turned on or off permanently by using the chkconfig on or chkconfig offcommands. They can typically be recognized by a "d" appended to their name, such as the packagekitd daemon. Refer to Chapter 10, Services and Daemons for information about system services.
(Sebelumnya) 13 : Chapter 6. Yum - Deployme ...13 : Part III. Networking - De ... (Berikutnya)