Ensurepass

10. Package Management with RPM
10.1 Installation
-i # Install a package.
-U # Upgrade existing package or install if it doesn’t already exist.
-e # Remove a package.
-F # Freshen. Only upgrade package if it’s already installed.
-v # Print verbose information
-h # Use a hash mark (#) to indicate progress
–nodeps # Don’t perform a dependency check when installing or upgrading a package
–replacefiles # Install package even if it overwrites existing files
–replacepkgs # Install package even if it’s already installed
–oldpackage # Install package even if it’s older than the one installed
–force # Combination of –replacefiles, –replacepkgs, and –oldpackage
Examples:
rpm -ivh groff-1.17.1-3.i386.rpm # Install groff from local file sytsem
rpm -Uvh groff-1.17.2-3.i386.rpm # Upgrade groff from local file system
rpm -e groff # Remove groff

# Install groff from anonymous ftp server
rpm -ivh ftp://somehost.com/rpms/groff-1.17.1-3.i386.rpm

# Install groff from non-anonymous ftp server
rpm -ivh ftp://:@somehost.com/rpms/groff-1.17.1-3.i386.rpm
10.2 Verification
–checksig # Verify md5 and gpg signatures.
-K # Same as –checksig.
–nogpg # Don’t verify gpg signature (must be used with –checksig).
-V # Verify installed files against package info and report changes.
-Va # Verify all packages
10.3 Query
-q # Returns package version.
-qf # Returns name of package that owns file.
-ql # Returns list of files own by package.
-qi # Returns package info.
-qpi # Returns info of uninstalled package
-qpl # Returns list of files in an uninstalled package
10.4 Source RPMs
Source RPMS install their contents into /usr/src/redhat. They contain everything necessary to build a binary package from the source (source code, init scripts, config files, man pages, documentation, etc.)
/usr/src/redhat:
* SOURCES – Contains source code and patches necessary to build rpm.
* BUILD – A work directory used to build the rpm.
* SPECS – Holds the spec files which describe how to build the rpm.
* SRPMS – Stores the completed source RPM after it’s built.
* RPMS – Stores the completed binary RPM after it’s built.
10.5 Spec Files
The RPM spec file contains the necessary instructions required to build an RPM. It contains many sections:
Preamble # Contains package information
Prep # Prepares source code for building (unpacking, patching, etc.)
Build # Steps taken to build source
Install # Commands used to install package
Install & Uninstall Scripts # Scripts that install/uninstall package from a system
Verify # Extra verification steps to take when verifying packages
Clean # Cleanup script
File List # List of files in the package
10.6 Build Options
-bp # Only execute prep stage
-bl # verify all files exist
-bc # Execute only the build stage
-bi # Execute only the install section
-bs # Only build SRPM
-ba # Build binary and source RPMs
-bb # Build binary RPM only

Download the Ensurepass Latest 2013 RHCE EX300 Practise Test PDF to pass RHCE EX300 exam.

Comments are closed.