Chapter 2: Managing Software Flashcards
Package
A collection of files that are installed on the computer
Dependency Information
Lists other packages that are required to install a package.
RPM Package Manager (RPM)
- The most popular package manager in the Linux world.
- Cross-platform and supports any CPU architecture
Convention for naming RPM packages
packagename-a.b.c-x.arch.rpm
packagename
The name of the package
a.b.c
The package version number
x (as in packagename-a.b.c-x.arch.rpm)
The build/release number, representing changes made by the package maintainer.
arch (as in packagename-a.b.c-x.arch.rpm)
A code for the package’s architecture.
Architecture Code for x86 CPU
i386
If a package is independent of CPU, what is put in the arch field?
noarch
What is the architecture code for source RPMs?
src
Compatibility Issues between RPM-based Distributions
- Different package dependencies
- Difference in names of dependent packages
- Slightly different files it depends on
- Basically dependencies!
rpm [operation][options] [package-files|package-names]
Used to install or upgrade a package at the shell prompt
rpm -i
Installs a package; note that the system must not contain a package of the same name
rpm -U
Installs a new package or upgrades an existing one
rpm -f
or
rpm –freshen
Upgrades a package only if an earlier version already exists
rpm -q
Finds whether a package is installed, what files it contains, and so on
rpm -e
Uninstalls a package
rpm -b
Builds a binary package, given source code and configuration files
(moved to rpmbuild with RPM version 4.2)
rpm –rebuild
Builds a binary package, given source RPM file
moved to rpmbuild with RPM version 4.2
rpm –rebuilddb
Rebuilds the RPM database to fix errors
rpm –root [dir]
Modifies the Linux system having a root directory located at dir.
Used with any operation.
rpm –force
- Forces installation of a package even when it means overwriting existing files or packages.
- Used with -i, -U, -F
rpm -h
or
rpm–hash
- Displays a series of hash marks (#) to indicate the progress of the operation
- Used with -i, -U, -F
rpm -v
-Used in conjunction with the -h option to produce a uniform number of hash marks for each package
rpm –nodeps
- Specifies that no dependency checks be performed
- Used with -i, -U, -F, -e
rpm –test
- Checks for dependencies, conflicts, and other problems without actually installing the package
- Used with -i, -U, -F
rpm –prefix [path]
- Sets the installation directory to path.
- Used with -i, -U, -F
rpm -a
or
rpm -all
- Queries or verifies all packages
- Used with -q, -V
rpm -f file
or
rpm –file file
- Queries or verifies the package that owns file.
- Used with -q, -V
rpm -p [package-file]
- Queries the uninstalled RPM package-file
- Used with -q
rpm -qi
Displays extra package info, and used to verify the package has been installed correctly
rpm -R
or
rpm –requires
-Displays the packages and files on which this depends
rpm -l
or
rpm –list
- Displays the files contained in the package
- Used with -q
If you want to do rpm on multiple packages, how do you list them?
Just separated by spaces on the command line yo
Which rpm operations require a package filename as opposed to a package name?
-i, -U, -F and rebuild operations
Which rpm operations take a package name as opposed to a package filename?
-q, -V, -e
Which commands must you use to extract info from an rpm command?
rpm2cpio to convert it to a cpio file, then pipe it to
cpio -i –makedirectories to extract the data
Note: always do this is in an empty subdirectory that is created for this purpose only
Yum
Enables you to install a package and all its dependencies easily using a single command line.
Three popular Linux distributions that use Yum
Red Hat, CentOS, and Fedora
yum [options] [command] [package…]
The command you use to use Yum
yum install
Installs one or more packages by package name, and the dependencies
yum update
Updates the specified package or packages
yum check-update
Checks to see whether updates are available and displays them if they are
yum remove
or
yum erase
Deletes a package from the system and depended-on packages
yum list
Displays information about a package
yum provides
or
yum whatprovides
Displays info about packages that provide a specified program or feature
yum search
Searches the repositories’ package names, summaries, packagers, and descriptions for a specific keyword
yum info
Displays info about a package, similar to
rpm -qi
yum clean
Cleans up the Yum cache directory to keep packages from chewing up too much disk space
yum shell
Enters the Yum shell mode, in which you can enter multiple Yum commands one after another.
yum resolvedep
Displays packages matching the specified dependency
yum localinstall
Installs the specified local RPM files
yum localupdate
Updates the system using the specified local RPM files
yum deplist
Displays the dependencies of the specified package
How to download a package but not install it with Yum?
yumdownloader [packagename]
Two GUIs for Yum
yumex and kyum
What is the main RPM configuration file?
/usr/lib/rpm/rpmrc
Which file should you create to make global RPM changes?
/etc/rpmrc
Which file should you create to make per-user RPM changes?
~/.rpmrc
What is the line you should add to a RPM configuration file to optimize architecture?
optflags
or
buildarchtranslate
What is the Yum configuration file?
/etc/yum.conf with additional config files in /etc/yum.repos.d
Livna
A Yum repository that hosts multimedia tools
KDE Red Hat
A Yum repository that provides improved KDE RPMs
Fresh RPMs
A Yum repository that provides additional RPMs, mostly focusing on multimedia applications and drivers.
How do RPM and Debian relate to OS and CPU type?
Their package formats are neutral with respect to em!
What was the original architecture of the Debian distribution?
x86
dpkg [options][action] [package-files|package-name]
Command used to install a Debian package
dpkg -i
or
dpkg –install
(action)
Installs a package
dpkg –configure
action
Reconfigures an installed package
dpkg -r
or
dpkg –remove
(action)
Removes a package but leaves the configuration files intact
dpkg -P
or
dpkg –purge
(action)
Removes a package, including configuration files
dpkg –get-selections
action
Displays currently installed packages
dpkg -p
or
dpkg –print-avail
(action)
Displays information about an installed package
dpkg -I (that is an i)
or
dpkg –info
(action)
Displays information about an uninstalled package file
dpkg - l [pattern]
or
dpkg –list [pattern]
(action)
Lists all installed packages whose names match pattern
dpkg -L
or
dpkg –listfiles
(action)
Lists the installed files associated with the package
dpkg -S [pattern]
or
dpkg –search [pattern]
(action)
Locates the package(s) that own the file(s) specified by pattern
dpkg -C
or
dpkg –audit
Searches for partially installed packages and suggests what to do with them
dpkg –root=[dir]
- Modifies the Linux system using a root directory located at “dir”
- Can be used with all actions
dpkg -B
or
dpkg –auto-deconfigure
- Disables packages that rely on one that is being removed
- Used with -r
dpkg –force-things
Overrides defaults that would normally cause dpkg to abort
dpkg –ignore-depends=[package]
- Ignores dependency information for the specified package
- Used with -i,-r
dpkg –no-act
- Checks for dependencies, conflicts, or other problems without actually installing or removing the package
- Used with -i, -r
dpkg –recursive
- Installs all packages that match the package-name wildcard in the specified directory and all subdirectories.
- Used with -i
dpkg -G
- Doesn’t install the package if a newer version of the same package is already installed
- Used with -i
dpkg -E
or
dpkg –skip-same-version
- Doesn’t install the package if the same version of the package is already installed
- Used with -i