Applications 10 - Yum – Other Options


Jarret W. Buse

Applications 10 - Yum – Other Options

Through the previous articles for managing applications and repositories through “yum”, there are also other additional options. These options are available to enhance the use of “yum” quite a bit more. The list of options are as follows:

  • -h (--help) – shows help for “yum”
  • -y (--assumeyes) – answer “yes” to all queries
  • --assumeno – answer “no” to all queries
  • -e (--errorlevel=) – sets level for error reporting, values are 0-10 with 0 being critical errors only
  • -q (--quiet) – no output is displayed and should --assumeyes or --assumeno
  • -v (--verbose) – verbose mode to show more details
  • -d (--debuglevel=) – sets output level for debug information, values are 0-10
  • --noplugins – no plugins are loaded
  • --disableplugin= – disable specific plugin (i.e. “langpacks”)
  • --enableplugin= – enables a specific plugin (i.e. “langpacks”)
  • --enablerepo= – enables a repository which is disabled for use by current command
  • --disablerepo= – disables a repository which is enabled for use by current command
  • --downloadonly – download package to /var/cache/yum/... but does not install the package
  • --downloaddir= – specifies alternate download location for storing packages
  • -C (--cacheonly) – runs command from cache only and does not download packages (uses from --downloadonly)
  • --rpmverbosity= – sets debug level for rpm script. Allowed values are “info” (default), “critical”, “emergency”, “error”, “warn” and “debug”
  • -R (--randomwait=[time]) – sets a maximum random amount of time for “yum” to wait before performing the specified command
  • --showduplicates – no limit to packages being the latest version in the info, list and search commands
  • --installroot= – specifies an alternate to installroot where packages will be installed
  • --obsoletes – used for an update to enable “yum” to process obsolete files
  • -x (--exclude=) – excludes a package from being seen in the repository list
  • --disableexcludes= – disables the excludes list from the config file, values are “all”, “main” and “repoid”
  • --disableincludes= – disables the includes list from the config file, values are “all” and “repoid”
  • --color= – shows colorized output, values are “always”, “never” and “auto”
  • --nogpgcheck – disables GPG signature key checking
  • --skip-broken – resolves broken package issues by ignoring them
  • -t (--tolerant) – makes “yum” perform more check to it more tolerant of external errors
  • --version – gives “yum” version number and packages in history

To get help for the use of “yum” use the following command:

yum -h

When performing any subcommand which prompt you to confirm a transaction, such as “install”, you can have “yum” confirm all with “yes” with the command:

sudo yum -y install transmission

In the same manner, all prompts can be answered as “no” with the following command:

sudo yum --assumeno install transmission

To check for errors when performing a subcommand, use the “--errorlevel” option as follows:

yum search samba --errorlevel=0

A subcommand can be be performed with no output at all. Be aware that any queries to the user will not be displayed. It is best to use the “--assumeyes” or “--assumeno” to answer queries as follows:

yum install samba -qy

To get more details on a subcommand when it is executed, use the “-v” option as shown:

yum search samba -v

To set the debug level you could perform the following:

yum install samba --debuglevel=0

To specify that no plugins are used, use the “--noplugins” option as follows:

yum install samba --noplugins

To disable a specific plugin, use the “--disableplugin” option:

yum search samba --disableplugin=langpacks

To enable a disabled plugin you can use the command:

yum search samba --enableplugin=langpacks

To enable a disabled repository for the current command only use:

yum search samba --enablerepo=fedora-source/21/x86_64

A repository which is enabled can be disabled for the current command only by:

yum search samba --disablerepo=fedora/21/x86_64

If you need to download a package and its dependencies, but not install it, use the following:

yum install --downloadonly samba

When the packages and the dependencies are downloaded, you can specify to save them to a different directory than the default:

yum install --downloadonly --downloaddir=/tmp/pinta/ pinta

Once files are downloaded, they can be installed from the download cache. If the files are not located in the default path, the packages can be used from the downloaded directory. The command is:

yum install -C --downloaddir=/tmp/pinta1/ pinta

If a “yum” command needed to be processed, but a wait was required, a wait time can be set in minutes (integers only):

yum repolist --randomwait=1

When performing a list, search or info subcommand, you can list duplicate packages with the --showduplicates option:

yum list samba* --showduplicates

When packages need to be installed in a different place than the root (/), use “--installroot=” option to specify a different location:

yum install gimp --installroot=/run/media/jarret/Data/

When you perform an update and also want to remove obsolete files, use the option “--obsoletes”:

yum update --obsoletes

If a specific package is listed in the repository list, but you do not want it to be installed, use the “--exclude=” option:

yum update --exclude=java-1.8.0-openjdk-headless.x86_64

If the yum.conf file contains an excluded list of repositories, they can be included with the option:

yum update --disableexcludes=all

If the includes list of the yum.conf needs to be excluded, use the option:

yum update --disableincludes=all

To add color to the yum output, the option “color=” can be used:

yum update --color=always

NOTE: Very little color is used in most commands.

When signature checking can be skipped, use the “--nogpgcheck” option:

yum install super-boot-manager --nogpgcheck

When performing an install or upgrade and broken packages are found, these issues can be skipped to continue the install with the following:

yum install gimp --skip-broken

To make “yum” more tolerant of errors, use the -t option:

yum upgrade -t

To find the version of “yum” and “rpm” use the --version option:

yum --version

These are the extra options usable by most of the “yum” commands from previous articles. In most cases, these options may not be used, but they can still be useful when needed.

Practice these options so you understand their use before taking the Linux+ exams.


Members online

Latest posts