Linux Operations and Administration Chapter Nine Installing Software Packages.

45
Linux Operations and Administration Chapter Nine Installing Software Packages

Transcript of Linux Operations and Administration Chapter Nine Installing Software Packages.

Page 1: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

Chapter NineInstalling Software Packages

Page 2: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

2

Page 3: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

3

Page 4: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

4

Page 5: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

5

Page 6: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

Working with RPM Software Packages (cont’d.)

• RPM– 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

6

Page 7: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

Working with RPM Software Packages (cont’d.)

• Packages built with RPM have some advantages:– Upgrading– Uninstalling– Verification– Querying

7

Page 8: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

8

Page 9: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

9

Page 10: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

The RPM Utility (cont’d.)

10

Table 9-1 Common rpm options

Page 11: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

Querying Packages

• Querying with rpm command– Gives package details from the RPM database

• -q option– Used to run a query– Used to determine version and release information

for software packages

11

Page 12: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

12

Page 13: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

13

Page 14: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

14

Page 15: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

Installing Packages (cont’d.)

• Functions performed by RPM utility during installation:– Dependency checks– Preinstallation tasks– Conflicts– Unpacking– Postinstallation tasks– Storage

15

Page 16: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

16

Page 17: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

17

Page 18: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

18

Page 19: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

19

Page 20: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

20

Page 21: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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-spotf-spot-0.6.1.5-1.2.1.i586rpm -e f-spot

21

Page 22: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

Uninstalling Packages (cont’d.)

• Activity 9-1: Using the RPM Utility– Download an RPM package and install, delete, and

upgrade it

22

Page 23: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

23

Page 24: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

24

Page 25: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

25

Page 26: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

RPM Dependencies (cont’d.)

26

Table 9-2 Front-end package managers

Page 27: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

27

Page 28: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

28

Page 29: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

The yast Command

• Can be used to configure:– 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

29

Page 30: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

The yast Command (cont’d.)

30

Table 9-3 Common yast options

Page 31: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

The yast Command (cont’d.)

• Activity 9-2: Using the yast Command– Use the yast command to install and remove a

package

31

Page 32: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

32

Page 33: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

Software Repositories (cont’d.)

33

Figure 9-1 The Configured Software Repositories tool© Cengage Learning 2013

Page 34: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

34

Page 35: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

Software Repositories (cont’d.)

35

Figure 9-2 An install error© Cengage Learning 2013

Page 36: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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/

36

Page 37: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

37

Page 38: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

38

Page 39: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

39

Page 40: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

YaST Software Manager (cont’d.)

40

Figure 9-3 YaST Software Manager© Cengage Learning 2013

Page 41: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

41

Page 42: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

42

Page 43: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

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

43

Page 44: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

Summary

• RPM Package Manager (RPM)– 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

44

Page 45: Linux Operations and Administration Chapter Nine Installing Software Packages.

Linux Operations and Administration

Summary (cont’d.)

• RPM dependencies feature– 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

45