Linux Operations and Administration Chapter Nine Installing Software Packages
Objectives Manage software packages with the RPM utility Handle RPM software dependencies Install, upgrade, and remove software at the command line Add remote software repositories in openSUSE Work with software packages in YaST Software Manager
Working with RPM Software Packages Software packages for Linux and UNIX used to be available in compressed tar archives called tarballs or in cpio (copy in/out) format Problems These formats had no features for upgrading or uninstalling software Installation was tedious Package management utilities developed to address these shortcomings
Working with RPM Software Packages (cont’d.) RPM Package Manager (RPM) Used to install and manage software packages Software package An archive of related files, such as configuration, data, and documentation files, constituting a software application Has a label containing metadata Metadata is descriptive information, such as name, version, size, and description of its contents
Working with RPM Software Packages (cont’d.) RPM utility Open-source software licensed under the GPL Many Linux distributions, including openSUSE, have it installed already Can be used on many OSs, such as OS/2, Solaris, AIX, Sun OS, IRIX, UNIX, and several Linux distributions
Working with RPM Software Packages (cont’d.) Used to build, install, query, verify, update, and uninstall software packages in Linux Can also be used to package a software application in source code or binary form RPM package Contains an archive of: Files Package details: such as name, version, and description
Working with RPM Software Packages (cont’d.) Packages built with RPM have some advantages: Upgrading Uninstalling Verification Querying
The RPM Utility rpm command can be used in one of the following modes: Querying Can be done by any user Installing, upgrading, and removing Can be done only by the root user
The RPM Utility (cont’d.) You might have to specify: Package name Source RPM name Package file Table 9-1 Describes common options used with this command
The RPM Utility (cont’d.) Table 9-1 Common rpm options
Querying Packages Querying with rpm command -q option Gives package details from the RPM database -q option Used to run a query Used to determine version and release information for software packages
Installing Packages RPM packages have an .rpm extension and filenaming conventions Example: OpenOffice_org-writer-3.1.1.4-1.2.3.i586.rpm Name Describes the software “OpenOffice_org-writer” in the example
Installing Packages (cont’d.) Version Indicates the package’s version number 3.1.1.4 in the example Release Software release number 1.2.3 in the example Architecture Specifies the architecture (the type of hardware the package is meant to run on) i586 in the example
Installing Packages (cont’d.) Example F-Spot package (version 0.6.1.5, release 1.1.1 for i586 hardware) installed with -i, -v, and -h options Second and third lines show some of command’s output
Installing Packages (cont’d.) Functions performed by RPM utility during installation: Dependency checks Preinstallation tasks Conflicts Unpacking Postinstallation tasks Storage
Upgrading Packages Upgrading packages with the RPM utility Similar to installing them, but you use the -U option Syntax example: rpm -U install-options package–filename Example where a software package is upgraded
Upgrading Packages (cont’d.) Smart update RPM retains previous version’s configuration file –U option also works well when no previous version of the package is on the system It simply installs the package instead of performing an upgrade
Upgrading Packages (cont’d.) -F (freshen) option Also used to upgrade software packages Can be used with a group of packages Especially useful if you have downloaded several packages and want to upgrade only the ones already installed
Upgrading Packages (cont’d.) Example showing use of -F option when a previous version doesn’t exist: Package wasn’t installed because no older version was in place
Upgrading Packages (cont’d.) Example showing use of -F option to upgrade an existing package: Command to upgrade only the packages for which an older version is already installed: # rpm –Fvh *.rpm
Uninstalling Packages RPM makes uninstalling packages fast and easy Use -e option in this format: rpm -e package–name You don’t have to specify package’s full name Example: rpm -q f-spot f-spot-0.6.1.5-1.2.1.i586 rpm -e f-spot
Uninstalling Packages (cont’d.) Activity 9-1: Using the RPM Utility Download an RPM package and install, delete, and upgrade it
RPM Dependencies RPM dependencies feature Determines whether a software package depends on another application to run Indicates what capabilities an installed package provides to other applications
RPM Dependencies (cont’d.) RPM dependencies feature useful in: Trying to delete a package that’s providing capabilities to another application Installing a software package that requires the capabilities of another application
RPM Dependencies (cont’d.) RPM “dependency loop” Solution: a front-end package manager Provides a user interface to make package management more user friendly Table 9-2 Describes a few widely used front-end package managers
RPM Dependencies (cont’d.) Table 9-2 Front-end package managers
Working with Software Packages in OpenSUSE After openSUSE is installed: Software packages are installed Repositories used to install or update packages are installed Repository A storage location for software packages Usually a Web server, but can also be on the local system
Working with Software Packages in OpenSUSE (cont’d.) Software in openSUSE is indexed You can search for software by using patterns Patterns are collections of packages that define a type of function Such as server packages
The yast Command Can be used to configure: Table 9-3 Hardware Network connections and clients Services General system options Such as language, partitioning, and boot loaders Table 9-3 Describes some common options used with yast command
The yast Command (cont’d.) Table 9-3 Common yast options
The yast Command (cont’d.) Activity 9-2: Using the yast Command Use the yast command to install and remove a package
Software Repositories openSUSE Configured Software Repositories tool Another resource for working with software packages To open: Use yast --gtk command as the root user Click Software Repositories icon
Software Repositories (cont’d.) Figure 9-1 The Configured Software Repositories tool © Cengage Learning 2013
Software Repositories (cont’d.) If yast command is used to install software that can’t be located in one of the repositories: Error similar to Figure 9-2 is shown To prevent this problem: Use Configured Software Repositories tool to add software repositories
Software Repositories (cont’d.) Figure 9-2 An install error © Cengage Learning 2013
Software Repositories (cont’d.) Three types of software repositories for version 11.2 that are available automatically: OSS (Open Source Software) http://download.opensuse.org/distribution/11.2/repo/oss/ NON-OSS (Not Open Source Software) http://download.opensuse.org/distribution/11.2/repo/non-oss/ Update (official security and bug-fix updates) http://download.opensuse.org/update/11.2/
Software Repositories (cont’d.) Table 9-4 Describes some common repositories that are available for download Activity 9-3: Using a Third-Party Software Repository Add a third-party software repository to your list of trusted repositories
YaST Software Manager OpenSUSE has a graphical utility for installing, updating, and removing software To open Software Manager On a KDE machine Click the Kickoff Application Launcher button Click the Applications tab Click System Click YaST
YaST Software Manager (cont’d.) Another method to open Software Manager Issue yast --gtk command (logged in as root) Click Software Management icon Buttons at the top of Software Manager window Available Displays packages that can be installed based on existing repositories Upgrades Displays packages for which newer versions are available
YaST Software Manager (cont’d.) Figure 9-3 YaST Software Manager © Cengage Learning 2013
YaST Software Manager (cont’d.) Installed Displays all packages installed on your system All Displays the combined results of the Available, Upgrades, and Installed lists
YaST Software Manager (cont’d.) Filter list box has the following selections: Groups Displays software packages by category, such as Admin Tools or Education Patterns Lists packages grouped by function, such as Base Technologies or Graphical Environments Languages Contains all language package files Repositories Filters packages based on the repository to which they belong
YaST Software Manager (cont’d.) Search field You can enter the name of a software package to see the RPM name and a summary of its attributes Activity 9-4: Working with the YaST Software Manager Use the YaST Software Manager to install, upgrade, and remove packages
Summary RPM Package Manager (RPM) Software package A utility used to install and manage software packages Software package An archive of related files constituting a software application RPM packages have several advantages over traditional packages rpm command is used to query the RPM database and install, remove, and upgrade packages
Summary (cont’d.) RPM dependencies feature Software repositories Determines whether a package relies on another application to run Software repositories Storage locations for software packages YaST Software Manager An easy-to-use GUI package manager yast command Used to install, update, and uninstall software packages along with their dependencies