%% $Header: /cvsroot/lcdp/lpic/general-linux-1/slides/gl1.102.6.slides.tex,v 1.4 2003/05/30 05:09:04 waratah Exp $ \input{gl1.slide-header.tex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %----10->|-----20->|-----30->|-----40->|-----50->|-----60->|-----70->|-----80-> \begin{slide} %================================================================ \begin{center} \LARGE \textsf{-- General Linux 2 -- \\ Use Red Hat Package Management} \LARGE \textsf{[5] } \\[2mm] \large \textsf{(Linux Professional Institute Certification)}\\[1mm] \normalsize\end{center} \footnote{Copyright \copyright\ 2002 Geoffrey Robertson. Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation---either version 2 of the License or (at your option) any later version.} \scriptsize \begin{verbatim} .~. by: Andrew Eager /V\ // \\ geoffrey robertson @._.@ geoffrey@zip.com.au \end{verbatim} \tiny \begin{verbatim} $Id: gl1.102.6.slides.tex,v 1.4 2003/05/30 05:09:04 waratah Exp $ \end{verbatim} \normalsize \vfill \end{slide} %----------------------------------------------------------- %----10->|-----20->|-----30->|-----40->|-----50->|-----60->|-----70->|-----80-> %============================================================================== \begin{slide} %ghr \listofslides \vfill \end{slide} %------------------------------------------------------------------------------ %============================================================================== \begin{slide}{} %ghr \Slidecontents \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide} %ghr \slideheading{(2.2) 102 Installation \& Package Mgt. [24]} \begin{description} \item[2.102.1] Design hard disk layout [2] \item[2.102.2] Install a boot manager [3] \item[2.102.3] Make and install programs from source [5] \item[2.102.4] Manage shared libraries [3] \item[2.102.5] Use Debian package management [5] \item[2.102.6] {\bf \underline{Use Red Hat Package Manager (RPM) [6]}} \end{description} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide}{} %ghr \Slidecontents \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide} %ghr \slideheading{Use Red Hat Package Management} \slidesubheading{Objective} Candidates should be able to perform package management under Linux distributions that use RPMs for package distribution. This objective includes being able to install, re-install, upgrade, and remove packages, as well as obtain status and version information on packages. This objective also includes obtaining package information such as version, status, dependencies, integrity, and signatures. Candidates should be able to determine what files a package provides, as well as find which package a specific file comes from. \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide} %ghr \Slideheading{Use Red Hat Package Management} \slidesubheading{Key files, terms, and utilities} \begin{alltt} /etc/rpmrc /usr/lib/rpm/* \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide} %ghr \Slideheading{Use Red Hat Package Management} \slidesubheading{Resources of interest} \begin{description} \item[]: \begin{alltt} \end{alltt} \end{description} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide}{} %ghr \Slidecontents \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{ RPM - RedHat Package Manager} \begin{itemize} \item RPM works with RedHat, SuSE \& Mandrake (among others) and can do the following: \begin{itemize} \overlay{1} \item Build an RPM package \overlay{2} \item Install an RPM package \overlay{3} \item Update an already installed RPM package \overlay{4} \item Query an RPM package \overlay{5} \item Erase an RPM package \overlay{6} \item Verify an RPM package. \end{itemize} \end{itemize} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{RPM Packages} \begin{itemize} \item RPM package files consist of a single compressed file much like a tarball. Package files can be sourced from: \begin{itemize} \item Local media (hard disk, cdrom etc) \item An ftp site \item An http site \end{itemize} \overlay{1} \item Packages sourced from local media are specified using just their filename. For example: \begin{itemize} \item acroread-4.05-1.i686.rpm \end{itemize} \overlay{2} \item Packages sourced from ftp or http sites are specified using the following syntax: \begin{itemize} \item ftp://USER:PASSWORD@HOST:PORT/path/to/package.rpm \end{itemize} \end{itemize} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{RPM Filenames} RPM Filenames use a standard naming scheme: \begin{alltt} \fbox{package}-version-patch.arch.rpm \end{alltt} \begin{description} \item [\fbox{package}] - The name of the package \item [version] - The version number \item [patch] - patch number of this package \item [arch] - The architecture this package is for (i386, i586, i686, alpha, sparc) \end{description} Example: \begin{alltt} \fbox{kernel}-2.4.9-21.i686.rpm \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{RPM Filenames} RPM Filenames use a standard naming scheme: \begin{alltt} package-\fbox{version}-patch.arch.rpm \end{alltt} \begin{description} \item [package] - The name of the package \item [\fbox{version}] - The version number \item [patch] - patch number of this package \item [arch] - The architecture this package is for (i386, i586, i686, alpha, sparc) \end{description} Example: \begin{alltt} kernel-\fbox{2.4.9}-21.i686.rpm \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{RPM Filenames} RPM Filenames use a standard naming scheme: \begin{alltt} package-version-\fbox{patch}.arch.rpm \end{alltt} \begin{description} \item [package] - The name of the package \item [version] - The version number \item [\fbox{patch}] - patch number of this package \item [arch] - The architecture this package is for (i386, i586, i686, alpha, sparc) \end{description} Example: \begin{alltt} kernel-2.4.9-\fbox{21}.i686.rpm \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{RPM Filenames} RPM Filenames use a standard naming scheme: \begin{alltt} package-version-patch.\fbox{arch}.rpm \end{alltt} \begin{description} \item [package] - The name of the package \item [version] - The version number \item [patch] - patch number of this package \item [\fbox{arch}] - The architecture this package is for (i386, i586, i686, alpha, sparc) \end{description} Example: \begin{alltt} kernel-2.4.9-21.\fbox{i686}.rpm \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{RPM Operating Modes} RPM operations are split up into 4 major modes: \begin{itemize} \overlay{1} \item Querying \& Verifying \overlay{2} \item Installing, Upgrading or Removing \overlay{3} \item Building Packages \overlay{4} \item RPM database administration functions \end{itemize} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Verifying package Integrity} Having downloaded an rpm from the Internet, the \underline{very first} thing you want to do is verify its integrity. You do this with the \texttt{-K} or \texttt{--checksig} option to rpm: \begin{alltt} # rpm -K kernel-2.4.9-31.i586.rpm kernel-2.4.9-31.i586.rpm: md5 gpg OK \end{alltt} NOTE: Some packages use PGP to check integrity while others use GnuPG. \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Installing, Upgrading \& Removing} Understanding the RPM terminology in relation to Installing, upgrading \& removing rpm packages is essential: \begin{itemize} \overlay{1} \item Install - Install a package. Good for Kernels \overlay{2} \item Upgrade - Upgrade a package if it's installed, otherwise install the package \overlay{3} \item Freshen - Upgrade a package only if it's already installed. \overlay{4} \item Erase - Remove a package. \end{itemize} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Installing, Upgrading \& Removing - Options} The table below summarises the various options used for package installation, freshening and removal. \begin{tabular}{|c|c|c|} \hline \textbf{\textcolor{blue}{Mode}}& \textbf{\textcolor{blue}{Short option}}& \textbf{\textcolor{blue}{Long option}}\\ \hline \hline Install& -i& \texttt{--install}\\ \hline Upgrade& -U& \texttt{--upgrade}\\ \hline Freshen& -F& \texttt{--freshen}\\ \hline Erase& -e& \texttt{--erase}\\ \hline \end{tabular} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Using RPM on the command line} Generally you use rpm in one of the following modes: \begin{itemize} \overlay{1} \item \texttt{rpm -i {[}install options{]} package\_file ...} \overlay{2} \item \texttt{rpm -U {[}install-options{]} package\_file ...} \overlay{3} \item \texttt{rpm -F {[}install-options{]} package\_file ...} \overlay{4} \item \texttt{rpm -e {[}erase-options{]} package\_name ...} \end{itemize} \begin{overlay}{5} Commonly used options are: \small \begin{description} \item [\opt{-v}] Verbose \overlay{6} \item [\opt{-h}] print progress hash marks \overlay{7} \item [\opt{--force}] Force RPM to overwrite existing packages or files \overlay{8} \item [\opt{--nodeps}] Bypass dependency checking \overlay{9} \item [\opt{--replacefiles}] Overwrite files owned by other packages \end{description} \end{overlay} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Example - install option} Install kernel-2.4.18-4 without removing the existing kernel: \begin{alltt} # rpm -q kernel kernel-2.4.9-21 # rpm -ivh kernel-2.4.18-4*.rpm Preparing... #################### [100%] 1:kernel-2.4.18-4 #################### [100%] # rpm -q kernel kernel-2.4.18-4 kernel-2.4.9-21 # \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Example - Freshen option} Upgrade the existing kernel to kernel-2.4.18-4. \begin{alltt} # rpm -q kernel kernel-2.4.9-21 # rpm -Uvh kernel-2.4.18-4*.rpm Preparing... #################### [100%] 1:kernel-2.4.18-4 #################### [100%] # rpm -q kernel kernel-2.4.18-4 # \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Example - Upgrade option:} What the upgrade option does will depend on whether or not the package is currently installed. If installed, it will perform a freshen, otherwise it will perform an install: \footnotesize \begin{alltt} \overlay{1}# rpm -q gocr package gocr is not installed \overlay{2}# rpm -Uvh gocr-0.3.4-1.i386.rpm Preparing... ###################### [100%] 1:gocr-0.3.4-1.rpm ###################### [100%] \overlay{3} # rpm -q gocr gocr-0.3.4-1 \overlay{4}# rpm -Uvh gocr-0.3.6-1.i386.rpm Preparing... ###################### [100%] 1:gocr-0.3.6-1.rpm ###################### [100%] \overlay{5}# rpm -q gocr gocr-0.3.6-1 \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Example - Erase option} Remove the package gocr from the system \begin{alltt} # rpm -q gocr gocr-0.3.6-1 # rpm -e gocr # rpm -q gocr # \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Querying Packages} RPM can be used to query a package (either installed or not). \begin{alltt} rpm {-q|--query} [select-options] [query-options] \end{alltt} \begin{description} \overlay{1} \item [Select options]: Choose what it is you want to query \begin{description} \item [\opt{-a}] Query all installed packages. \item [\opt{-f}] Query package owning FILE. \item [\opt{-p}] Query an (uninstalled) package file \end{description} \overlay{2} \item [Query options]: Choose what it is you want to see from the query: \begin{description} \item [\opt{-i}] Show all information about the package \item [\opt{-l}] Show what files are contained in the package \item [\opt{-R}] List packages on which this package depends \end{description} \end{description} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Query - Example} \slidesubheading{Give a list of all packages with kern in their name:} \begin{alltt} \cmd{ rpm -qa | grep kern} kernelcfg-0.5-5 glibc-kernheaders-2.4-7.14 kernel-2.4.9-21 kernel-source-2.4.18-4 \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Query - Example} \slidesubheading{Show a list of all files in kernel-2.4.9-21} \begin{alltt} \cmd{rpm -ql kernel-2.4.9-21} /boot/System.map-2.4.9-21 /boot/module-info-2.4.9-21 /boot/vmlinuz-2.4.9-21 .... \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Query - Example} \slidesubheading{Show package which owns /bin/ls:} \begin{alltt} \cmd{rpm -qf /bin/ls} \cmd{fileutils-4.1-10} \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{} Show complete information about the fileutils package: \scriptsize \begin{alltt} \cmd{rpm -qi fileutils} Name : fileutils Relocations: (not relocateable) Version : 4.1 Vendor: Red Hat, Inc. Release : 10 Build Date: Mon 25 Mar 2002 12:23:22 PM EST Install date: Fri 24 May 2002 02:18:08 PM EST Build Host: daffy.perf.redhat.com Group : Applications/File Source RPM: fileutils-4.1-10.src.rpm Size : 1679468 License: GPL Packager : Red Hat, Inc. Summary : The GNU versions of common file management utilities. Description : The fileutils package includes a number of GNU versions of common and popular file management utilities. Fileutils includes the following tools: chgrp (changes a file's group ownership), chown (changes a file's ownership), chmod (changes a file's permissions), cp (copies files), dd (copies and converts files), df (shows a filesystem's disk usage), dir (gives a brief directory listing), dircolors (the setup program for the color version of the ls command), du (shows disk usage), install (copies files and sets permissions), ln (creates file links), ls (lists directory contents), mkdir (creates directories), mkfifo (creates FIFOs or named pipes), mknod (creates special files), mv (renames files), rm (removes/deletes files), rmdir (removes empty \end{alltt} %directories), sync (synchronizes memory and disk), touch (changes file %timestamps), and vdir (provides long directory listings). \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Verifying package files} This option to rpm is used to verify the \underline{files installed} on the system with those from the rpm package file. This is not to be confused with the \textit{integrity} of the package file. The following table lists the characteristics verified: \footnotesize \begin{description} \item [\opt{5}] - The MD5 checksum \item [\opt{S}] - The file size \item [\opt{L}] - Symbolic link \item [\opt{T}] - Modification time \item [\opt{D}] - Device major \& minor number \item [\opt{U}] - User owner \item [\opt{G}] - Group owner \item [\opt{M}] - Permission and/or file type \end{description} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== %============================================================================== \begin{slide}{} \slideheading{Example - Verify package} Verify the setup package against the originally installed version. \begin{alltt} \cmd{rpm -V setup} S.5....T c /etc/bashrc S.5....T c /etc/csh.cshrc S.5....T c /etc/csh.login S.5....T c /etc/host.conf S.5....T c /etc/printcap S.5....T c /etc/profile ..?..... c /etc/securetty .M...... c /etc/shadow \end{alltt} \vfill \end{slide} %----------------------------------------------------------- %============================================================================== \begin{slide}{} %ghr \heading{The End} \Slidecontents \vfill \end{slide} %----------------------------------------------------------- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %============================================================================== %============================================================================== \begin{slide}{} \slideheading{} \vfill \end{slide} %----------------------------------------------------------- ============================================================================= \begin{slide}{} \end{slide} %------------------------------------------------------------------