2.2.3. Installing and Removing Packages (and Dependencies)
With the two filters selected, Only available and Only end user files, search for the htop interactive process viewer 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 ( → → in our case); 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.
Check htop and click the Apply button. You will then be prompted for the superuser password; enter it, and PackageKit will install htop. One nice feature of PackageKit is that, following installation, it sometimes presents you with a list of your newly-installed applications and offer 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 htop
, an colorful and enhanced version of the top
process viewer, by opening a shell prompt and entering:
~]$ htop
htop is nifty, but we decide that top
is good enough for us 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 htop 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 misbehave and/or crash.