Linux Package Command Sets

  • rpm — install or upgrade a package at a shell prompt
    • used with Red Hat builds, also Madriva (formerly Mandrake), Yellow Dog, SUSE
    • RPM COMMANDS:
      • [ -i ] installs a package but system must not contain a package of the same name
      • [ -U ] installs a new package or upgrades an existing one
      • [ -F ] upgrades a package only if an earlier version already exists
      • [ -q ] queries a package (is it installed, what does it contain, etc… )
      • [ -V ] verifies a package
      • [ -e ] uninstalls a package
      • [ -b ] builds a binary package, given source code and files (‘rpmbuild’ in new versions)
      • [ –rebuild ] builds a binary package, given a source RPM file (‘rpmbuild’ in new versions)
      • [ –rebuilddb ] rebuilds the RPM database to fix errors
    • RPM COMMAND OPTIONS:
      • [ –root + dir ] (used with any command) modifies the Linux system having a root directory at ‘dir’
      • [ –force ] (-i, -U, -F) forces installation of a package when it means overwriting existing files
      • [ -h ] (-i, -U, -F) displays a series of hash marks to indicate the progress of the operation
      • [ -v ] (-i, -U, -F) used with -h to produce a uniform number of hash marks for each package
      • [ –nodeps ] (-i, -U, -F, -e) specifies that no dependency checks be performed
      • [ –test ] (-i, -U, -F) checks for dependencies, conflicts and other programs without installing
      • [ –prefix + path ] (-i, -U, -F) sets the installation directory path (doesn’t work on all packages)
      • [ -a ] (-q, -V) queries or verifies all packages
      • [ -f + file ] queries the uninstalled RPM ‘package file’
      • [ -i ] (-q) displays package information
      • [ -R ] (-q) displays the package and files on which this one depends
      • [ -I (eye) ] (-q) displays the files contained in the package
  • yum — enables you to easily install a package and all its dependencies using a single command line
    • used with Red Hat, CentOS, Fedora, and some other RPM-based distributions
    • YUM COMMANDS:
      • [ install ] installs one or more packages by package name (with dependencies)
      • [ update ] updates the specified package to the latest version
      • [ check-update ] checks to see whether updates are available on your system
      • [ upgrade ] works like update, but handles obsolete packages when performing a distribution upgrade
      • [ remove or erase ] deletes a package from a system.  Also removes depended-on packages
      • [ list ] displays info about a package
      • [ provides or whatprovides ] lists all related packages to a specified program
      • [ search ] searches for a specified package name
      • [ info ] displays info about a package
      • [ clean ] cleans up the Yum cache directory (run this command from time to time)
      • [ shell ] enters the Yum shell mode to enter multiple commands one after the other
      • [ resolvedep ] displays packages matching the specified dependency
      • [ localinstall ] installs the specified local RPM file using Yum to resolve dependencies
      • [ localupdate ] updates the system using the specified local RPM file and resolving with Yum repos
      • [ deplist ] displays dependencies of the specified package
      • [ yumdownloader ] obtain the package without an install
  • dpkg — used for installing Debian packages (not compatible with RPM packages)
    • DPKG COMMANDS:
      • [ -i ] installs a package
      • [ -r ] removes a package but leaves the configuration files
      • [ -P ] removes a package, including the configuration files
      • [ –get-selections ] displays currently installed packages
      • [ -p ] displays information about an installed package
      • [ -I (eye) ] displays information about an uninstalled package
      • [ -L ] lists the installed files associated with a package
      • [ -S + pattern ] locates the package that own the files specified by the pattern
      • [ -C ] searches for partially installed packages and suggests what to do with them
    • DPKG COMMANDS OPTIONS:
      • [ –root=directory ] modifies the system using a root directory of your choosing  (emergencies)
      • [ -B ] (-r) disables packages that rely on one that is being removed
      • [ –force-things ] (assorted commands) overrides defaults that would ordinarily cause dpkg to abort
      • [ –ignore-depends=package ] (-i, -r) ignores dependency information for specified package
      • [ –no-act ] (-i, -r) checks for dependencies/conflicts without installing or removing packages
      • [ –recursive ] (-i) installs all packages that match the package name wildcard
      • [ -G] (-i) diesn’t install the package if a newer version of the same package is installed
      • [ -E ] (-i) doesn’t install the package if the same version is already installed
  • apt-get — is the Debian equivalent to the Yum command automating the dpkg installations
    • COMMANDS:
      • [ update ] obtains updated information about packages available in (/etc/apt/sources.list)
      • [ upgrade ] upgrades all installed packages to the newest versions (perform an update first)
      • [ dselect-upgrade ] performs any changes in package status left undone after dselect
      • [ dist-upgrade ] similar to upgrade but performs conflict resolution (won’t break dependencies)
      • [ install ] installs a package by the package name given (perform update first)
      • [ remove ] removes a specific package
      • [ source ] retrieves the newest available source package file
      • [ check ] checks the package database for consistency and broken package installations
      • [ clean] clears out information about retrieved files from the database
      • [ autoclean ] similar to clean, but removes info only about packages that can’t be downloaded
    • COMMAND OPTIONS:
      • [ -d ] downloads package files but doesn’t install them
      • [ -f ] attempts to fix a system on which dependencies are unsatisfied
      • [ -m ] ignores all package files that can’t be retrieved
      • [ -q ] omits some progress indicator info (doubled for even less progress information)
      • [ -s ] performs a simulation of the action without actually modifying, installing, or removing files
      • [ -y ] gives a yes response to all prompts
      • [ -b ] compiles a source package after retrieving it
      • [ –no-upgrade ] causes apt-get to not upgrade a package if an older version is already installed
Scroll to top