getting and managing software -...

30
Getting and Managing Software ‘15H2 Inshik Song

Upload: others

Post on 21-May-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Getting and Managing Software

‘15H2

Inshik Song

Page 2: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

• Working with RPM packaging

• Using yum to manage packages

• Using rpm to work with packages

Outline

Getting and Managing Software 2

Page 3: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

• While it is easy to create a tarball and just drop a set of software onto your Linux system, this method of installing software makes it difficult to:– Get dependent S/W

– List the S/W

– Remove the S/W

– Update the S/W

• To deal with these problems, packages progressed from simple tarballs to more complex packaging– DEB (.deb) : Debian ( Ubuntu, Linux Mint, KNOPPIX, etc.)

– RPM (.rpm) : Red Hat ( SUSE, CentOS, Oracle Linux, etc.)

Understanding Linux RPM Software Packaging

Getting and Managing Software 3

Page 4: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

• An RPM package is a consolidation of files needed to provide a feature– Commands

– Configuration files

– Documentation

• An RPM file also contains metadata that stores information about the contents of that package, where the package came from, what it needs to run, and other information

Understanding RPM packaging

Getting and Managing Software 4

Page 5: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

What is in an RPM?

Getting and Managing Software 5

Page 6: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Where do RPMs come from?

Getting and Managing Software 6

• A Linux distribution takes the source code and builds it into binaries. Then it gathers those binaries together with documentation, configuration files, and other components available from the upstream provider

• After gathering all those components into the RPM, the RPM package is signed (so users can test the package for validity) and placed in a repository of RPMs for the specific distribution and architecture (32-bit x86, 64-bit x86, and so on)

Page 7: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Installing RPMs

Getting and Managing Software 7

• Using rpm, you can install, update, query, validate, and remove RPM packages.

• The command, however, has a few major drawbacks:– Dependencies

– Location of RPMs

Page 8: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Managing RPM Packages with YUM

Getting and Managing Software 8

• The YellowDog Updater Modified (YUM) project set out to solve the headache of managing dependencies with RPM packages

• Its major contribution was to stop thinking about RPM packages as individual components and think of them as parts of larger software repositories– The yum repositories could be put in a directory on a web server

(http://), FTP server (ftp://), or local medium such as a CD, DVD, or local directory (file://).

– The locations of these repositories would then be stored on the user’s system in the /etc/yum.conf file or, more typically, in separate configuration files in the /etc/yum.repos.d directory.

Page 9: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Understanding how yum works

Getting and Managing Software 9

Page 10: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Searching for packages

Getting and Managing Software 10

• Use search subcommand to look for the term “editor” in the name or description:

Page 11: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Searching for packages

Getting and Managing Software 11

• To get information about that package, I can use the info subcommand:

Page 12: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Searching for packages

Getting and Managing Software 12

• If you know the command, configuration file, or library name you want, but don’t know what package it is in, use the provides subcommand to search for the package:

Page 13: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Searching for packages

Getting and Managing Software 13

• The list subcommand can be used to list package names in different ways:

Page 14: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Searching for packages

Getting and Managing Software 14

• If you find a package, but want to see what components that package is dependent on, you can use the deplist subcommand:

Page 15: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Installing and removing packages

Getting and Managing Software 15

• The install subcommand lets you install one or more packages, along with any dependent packages needed:

Page 16: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Installing and removing packages

Getting and Managing Software 16

• You can reinstall a package if you mistakenly delete components of an installed package:

Page 17: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Installing and removing packages

Getting and Managing Software 17

• You can remove a single package with the erasesubcommand:

Page 18: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Installing and removing packages

Getting and Managing Software 18

• An alternative method to remove a set of packages you have installed is to use the history subcommand:

Page 19: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Updating packages

Getting and Managing Software 19

• The check-update subcommand can check for updates.

• The update subcommand can be used to update a single package or to get updates to all packages that are currently installed and have an update available

Page 20: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Updating groups of packages

Getting and Managing Software 20

Page 21: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Maintaining your RPM package database and cache

Getting and Managing Software 21

Page 22: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Downloading RPMs from a yum repository

Getting and Managing Software 22

• If you just want to examine a package without actually installing it, you can use the yumdownloadercommand:

Page 23: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Installing, Querying, and Verifying Software with the rpm Command

Getting and Managing Software 23

• The rpm command contains dozens of options to enable you to find information about each package, such as the files it contains, who created it, when it was installed, how large it is, and many other attributes

• The rpm command can still do basic install and upgrade activities, although most people only use rpm in that way when there is a package sitting in the local directory, ready to be installed

Page 24: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Installing and removing packages with rpm

Getting and Managing Software 24

• To install a package

• To upgrade/install a package

• To freshen a package

• To remove a package

Page 25: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Querying rpm information

Getting and Managing Software 25

Page 26: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Querying rpm information

Getting and Managing Software 26

Page 27: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Querying rpm information

Getting and Managing Software 27

Page 28: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Verifying RPM packages

Getting and Managing Software 28

Page 29: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Verifying RPM packages

Getting and Managing Software 29

Page 30: Getting and Managing Software - KOCWcontents.kocw.net/KOCW/document/2015/chungang/songinshik/1.pdf• Using yum to manage packages • Using rpm to work with packages Outline ... and

Questions?

Getting and Managing Software 30