Which of the following dnf options will display whether updates are available for rpm packages?

RHEL 8 introduces the concept of Application Streams. Multiple versions of user space components are now delivered and updated more frequently than the core operating system packages. This provides greater flexibility to customize Red Hat Enterprise Linux without impacting the underlying stability of the platform or specific deployments.

Components made available as Application Streams can be packaged as modules or RPM packages, and are delivered through the AppStream repository in RHEL 8. Each Application Stream has a given life cycle, either the same as RHEL 8 or shorter, more suitable to the particular application. Application Streams with a shorter life cycle are listed in the Red Hat Enterprise Linux 8 Application Streams Life Cycle page.

Modules are collections of packages representing a logical unit: an application, a language stack, a database, or a set of tools. These packages are built, tested, and released together.

Module streams represent versions of the Application Stream components. For example, two streams (versions) of the PostgreSQL database server are available in the postgresql module: PostgreSQL 10 (the default stream) and PostgreSQL 9.6. Only one module stream can be installed on the system. Different versions can be used in separate containers.

Detailed module commands are described in the Installing, managing, and removing user-space components document. For a list of modules available in AppStream, see the Package manifest.

yum allows you to perform a complete set of operations with software packages.

The following section describes how to use yum to:

  • Search for packages.
  • List packages.
  • List repositories.
  • Display information about the packages.
  • List package groups.
  • Specify global expressions in yum input.

Use the following procedure to find a package providing a particular application or other content.

Procedure

  • To search for a package, use:

    # yum search term

    Replace term with a term related to the package.

    Note that yum search command returns term matches within the name and summary of the packages. This makes the search faster and enables you to search for packages you do not know the name of, but for which you know a related term.

  • To include term matches within package descriptions, use:

    # yum search --all term

    Replace term with a term you want to search for in a package name, summary, or description.

    Note that yum search --all enables a more exhaustive but slower search.

Use the following procedure to list installed and available packages.

Procedure

  • To list information on all installed and available packages, use:

    # yum list --all
  • To list all packages installed on your system, use:

    # yum list --installed
  • To list all packages in all enabled repositories that are available to install, use:

    # yum list --available

Note that you can filter the results by appending global expressions as arguments. See Specifying global expressions in yum input for more details.

Use the following procedure to list enabled and disabled repositories.

Procedure

  • To list all enabled repositories on your system, use:

    # yum repolist
  • To list all disabled repositories on your system, use:

    # yum repolist --disabled
  • To list both enabled and disabled repositories, use:

    # yum repolist --all
  • To list additional information about the repositories, use:

    # yum repoinfo

Note that you can filter the results by passing the ID or name of repositories as arguments or by appending global expressions. See Specifying global expressions in yum input for more details.

You can display various types of information about a package using YUM, for example version, release, size, loaded plugins, and more.

Procedure

  • To display information about one or more packages, use:

    # yum info package-name

    Replace package-name with the name of the package.

Note that you can filter the results by appending global expressions as arguments. See Specifying global expressions in yum input for more details.

Use yum to view installed package groups and filter the listing results.

Procedure

  • To view the number of installed and available groups, use:

    # yum group summary
  • To list all installed and available groups, use:

    # yum group list

    Note that you can filter the results by appending command line options for the yum group list command (--hidden, --available). For more available options see the man pages.

  • To list mandatory and optional packages contained in a particular group, use:

    # yum group info group-name

    Replace group-name with the name of the group.

Note that you can filter the results by appending global expressions as arguments. See Specifying global expressions in yum input for more details.

yum commands allow you to filter the results by appending one or more glob expressions as arguments. You have to escape global expressions when passing them as arguments to the yum command.

Procedure

To ensure global expressions are passed to yum as intended, use one of the following methods:

  • Double-quote or single-quote the entire global expression.

    # yum provides "*/file-name"

    Replace file-name with the name of the file.

  • Escape the wildcard characters by preceding them with a backslash (\) character.

    # yum provides \*/file-name

    Replace file-name with the name of the file.

The following section describes how to use yum to:

  • Install packages.
  • Install a package group.
  • Specify a package name in yum input.

  • To install a package and all the package dependencies, use:

    # yum install package-name

    Replace package-name with the name of the package.

  • To install multiple packages and their dependencies simultaneously, use:

    # yum install package-name-1 package-name-2

    Replace package-name-1 and package-name-2 with the names of the packages.

  • When installing packages on a multilib system (AMD64, Intel 64 machine), you can specify the architecture of the package by appending it to the package name:

    # yum install package-name.arch

    Replace package-name.arch with the name and architecture of the package.

  • If you know the name of the binary you want to install, but not the package name, you can use the path to the binary as an argument:

    # yum install /usr/sbin/binary-file

    Replace /usr/sbin/binary-file with a path to the binary file.

    yum searches through the package lists, finds the package which provides /usr/sbin/binary-file, and prompts you as to whether you want to install it.

  • To install a previously-downloaded package from a local directory, use:

    # yum install /path/

    Replace /path/ with the path to the package.

Note that you can optimize the package search by explicitly defining how to parse the argument. See Section 12.4.3, “Specifying a package name in YUM input” for more details.

The following procedure describes how to install a package group by a group name or by a groupID using yum.

Procedure

  • To install a package group by a group name, use:

    # yum group install group-name

    Or

    # yum install @group-name

    Replace group-name with the full name of the group or environmental group.

  • To install a package group by the groupID, use:

    # yum group install groupID

    Replace groupID with the ID of the group.

To optimize the installation and removal process, you can append -n, -na, or -nerva suffixes to yum install and yum remove commands to explicitly define how to parse an argument:

  • To install a package using its exact name, use:

    # yum install-n name

    Replace name with the exact name of the package.

  • To install a package using its exact name and architecture, use:

    # yum install-na name.architecture

    Replace name and architecture with the exact name and architecture of the package.

  • To install a package using its exact name, epoch, version, release, and architecture, use:

    # yum install-nevra name-epoch:version-release.architecture

    Replace name, epoch, version, release, and architecture with the exact name, epoch, version, release, and architecture of the package.

yum allows you to check if your system has any pending updates. You can list packages that need updating and choose to update a single package, multiple packages, or all packages at once. If any of the packages you choose to update have dependencies, they are updated as well.

The following section describes how to use yum to:

  • Check for updates.
  • Update a single package.
  • Update a package group.
  • Update all packages and their dependencies.
  • Apply security updates.
  • Automate software updates.

The following procedure describes how to check the available updates for packages installed on your system using yum.

Procedure

  • To see which packages installed on your system have available updates, use:

    # yum check-update

    The output returns the list of packages and their dependencies that have an update available.

Use the following procedure to update a single package and its dependencies using yum.

  • To update a package, use:

    # yum update package-name

    Replace package-name with the name of the package.

When applying updates to kernel, yum always installs a new kernel regardless of whether you are using the yum update or yum install command.

Use the following procedure to update a group of packages and their dependencies using yum.

Procedure

  • To update a package group, use:

    # yum group update group-name

    Replace group-name with the name of the package group.

Use the following procedure to update all packages and their dependencies using yum.

Procedure

  • To update all packages and their dependencies, use:

    # yum update

To check and download package updates automatically and regularly, you can use the DNF Automatic tool that is provided by the dnf-automatic package.

DNF Automatic is an alternative command-line interface to yum that is suited for automatic and regular execution using systemd timers, cron jobs and other such tools.

DNF Automatic synchronizes package metadata as needed and then checks for updates available. After, the tool can perform one of the following actions depending on how you configure it:

  • Exit
  • Download updated packages
  • Download and apply the updates

The outcome of the operation is then reported by a selected mechanism, such as the standard output or email.

The following procedure describes how to install the DNF Automatic tool.

Procedure

  • To install the dnf-automatic package, use:

    # yum install dnf-automatic

Verification steps

  • To verify the successful installation, confirm the presence of the dnf-automatic package by running the following command:

    # rpm -qi dnf-automatic

By default, DNF Automatic uses /etc/dnf/automatic.conf as its configuration file to define its behavior.

The configuration file is separated into the following topical sections:

  • [commands] section

    Sets the mode of operation of DNF Automatic.

  • [emitters] section

    Defines how the results of DNF Automatic are reported.

  • [command_email] section

    Provides the email emitter configuration for an external command used to send email.

  • [email] section

    Provides the email emitter configuration.

  • [base] section

    Overrides settings from the main configuration file of yum.

With the default settings of the /etc/dnf/automatic.conf file, DNF Automatic checks for available updates, downloads them, and reports the results as standard output.

Settings of the operation mode from the [commands] section are overridden by settings used by a systemd timer unit for all timer units except dnf-automatic.timer.

Additional resources

  • For more details on particular sections, see DNF Automatic documentation.
  • For more details on systemd timer units, see the man dnf-automatic manual pages.
  • For the overview of the systemd timer units included in the dnf-automatic package, see Section Overview of the systemd timer units included in the dnf-automatic package link://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-software-packages_configuring-basic-system-settings#overview-of-the-systemd-timer-units-included-in-the-dnf-automatic-package_automating-software-updates

To run DNF Automatic, you always need to enable and start a specific systemd timer unit. You can use one of the timer units provided in the dnf-automatic package, or you can write your own timer unit depending on your needs.

The following section describes how to enable DNF Automatic.

Prerequisites

  • You specified the behavior of DNF Automatic by modifying the /etc/dnf/automatic.conf configuration file.

For more information on DNF Automatic configuration file, see Section 2.5.6.2, “DNF Automatic configuration file”.

Procedure

  • Select, enable and start a systemd timer unit that fits your needs:

    # systemctl enable --now <unit>

    where <unit> is one of the following timers:

    • dnf-automatic-download.timer
    • dnf-automatic-install.timer
    • dnf-automatic-notifyonly.timer
    • dnf-automatic.timer

For downloading available updates, use:

# systemctl enable dnf-automatic-download.timer# systemctl start dnf-automatic-download.timer

For downloading and installing available updates, use:

# systemctl enable dnf-automatic-install.timer# systemctl start dnf-automatic-install.timer

For reporting about available updates, use:

# systemctl enable dnf-automatic-notifyonly.timer# systemctl start dnf-automatic-notifyonly.timer

Optionally, you can use:

# systemctl enable dnf-automatic.timer# systemctl start dnf-automatic.timer

In terms of downloading and applying updates, this timer unit behaves according to settings in the /etc/dnf/automatic.conf configuration file. The default behavior is similar to dnf-automatic-download.timer: it downloads the updated packages, but it does not install them.

Alternatively, you can also run DNF Automatic by executing the /usr/bin/dnf-automatic file directly from the command line or from a custom script.

Verification steps

  • To verify that the timer is enabled, run the following command:

    # systemctl status <systemd timer unit>

The systemd timer units take precedence and override the settings in the /etc/dnf/automatic.conf configuration file concerning downloading and applying updates.

For example if you set the following option in the /etc/dnf/automatic.conf configuration file, but you have activated the dnf-automatic-notifyonly.timer unit, the packages will not be downloaded:

download_updates = yes

The dnf-automatic package includes the following systemd timer units:

Additional resources

  • For more information on the dnf-automatic timers, see the man dnf-automatic manual pages.
  • For more information on the /etc/dnf/automatic.conf configuration file, see Section DNF Automatic configuration file

The following section describes how to use yum to:

  • Remove packages.
  • Remove a package group.
  • Specify a package name in yum input.

Use the following procedure to remove a package either by the group name or the groupID.

Procedure

  • To remove a particular package and all dependent packages, use:

    # yum remove package-name

    Replace package-name with the name of the package.

  • To remove multiple packages and their dependencies simultaneously, use:

    # yum remove package-name-1 package-name-2

    Replace package-name-1 and package-name-2 with the names of the packages.

yum is not able to remove a package without removing depending packages.

Note that you can optimize the package search by explicitly defining how to parse the argument. See Specifying a package name in yum input for more details.

Use the following procedure to remove a package either by the group name or the groupID.

Procedure

  • To remove a package group by the group name, use:

    # yum group remove group-name

    Or

    # yum remove @group-name

    Replace group-name with the full name of the group.

  • To remove a package group by the groupID, use:

    # yum group remove groupID

    Replace groupID with the ID of the group.

To optimize the installation and removal process, you can append -n, -na, or -nerva suffixes to yum install and yum remove commands to explicitly define how to parse an argument:

  • To install a package using its exact name, use:

    # yum install-n name

    Replace name with the exact name of the package.

  • To install a package using its exact name and architecture, use:

    # yum install-na name.architecture

    Replace name and architecture with the exact name and architecture of the package.

  • To install a package using its exact name, epoch, version, release, and architecture, use:

    # yum install-nevra name-epoch:version-release.architecture

    Replace name, epoch, version, release, and architecture with the exact name, epoch, version, release, and architecture of the package.

A package group is a collection of packages that serve a common purpose (System Tools, Sound and Video). Installing a package group pulls a set of dependent packages, which saves time considerably.

The following section describes how to use yum to:

  • List package groups.
  • Install a package group.
  • Remove a package group.
  • Specify global expressions in yum input.

Use yum to view installed package groups and filter the listing results.

Procedure

  • To view the number of installed and available groups, use:

    # yum group summary
  • To list all installed and available groups, use:

    # yum group list

    Note that you can filter the results by appending command line options for the yum group list command (--hidden, --available). For more available options see the man pages.

  • To list mandatory and optional packages contained in a particular group, use:

    # yum group info group-name

    Replace group-name with the name of the group.

Note that you can filter the results by appending global expressions as arguments. See Specifying global expressions in yum input for more details.

The following procedure describes how to install a package group by a group name or by a groupID using yum.

Procedure

  • To install a package group by a group name, use:

    # yum group install group-name

    Or

    # yum install @group-name

    Replace group-name with the full name of the group or environmental group.

  • To install a package group by the groupID, use:

    # yum group install groupID

    Replace groupID with the ID of the group.

Use the following procedure to remove a package either by the group name or the groupID.

Procedure

  • To remove a package group by the group name, use:

    # yum group remove group-name

    Or

    # yum remove @group-name

    Replace group-name with the full name of the group.

  • To remove a package group by the groupID, use:

    # yum group remove groupID

    Replace groupID with the ID of the group.

yum commands allow you to filter the results by appending one or more glob expressions as arguments. You have to escape global expressions when passing them as arguments to the yum command.

Procedure

To ensure global expressions are passed to yum as intended, use one of the following methods:

  • Double-quote or single-quote the entire global expression.

    # yum provides "*/file-name"

    Replace file-name with the name of the file.

  • Escape the wildcard characters by preceding them with a backslash (\) character.

    # yum provides \*/file-name

    Replace file-name with the name of the file.

The yum history command allows you to review information about the timeline of yum transactions, dates and times they occurred, the number of packages affected, whether these transactions succeeded or were aborted, and if the RPM database was changed between transactions. yum history command can also be used to undo or redo the transactions.

The following section describes how to use yum to:

  • List transactions.
  • Revert transactions.
  • Repeat transactions.
  • Specify global expressions in yum input.

Use the following procedure to list the latest transactions, the latest operations for a selected package, and details of a particular transaction.

Procedure

  • To display a list of all the latest yum transactions, use:

    # yum history
  • To display a list of all the latest operations for a selected package, use:

    # yum history list package-name

    Replace package-name with the name of the package. You can filter the command output by appending global expressions. See Specifying global expressions in yum input for more details.

  • To examine a particular transaction, use:

    # yum history info transactionID

    Replace transactionID with the ID of the transaction.

The following procedure describes how to revert a selected transaction or the last transaction using yum.

Procedure

  • To revert a particular transaction, use:

    # yum history undo transactionID

    Replace transactionID with the ID of the transaction.

  • To revert the last transaction, use:

    # yum history undo last

Note that the yum history undo command only reverts the steps that were performed during the transaction. If the transaction installed a new package, the yum history undo command uninstalls it. If the transaction uninstalled a package, the yum history undo command reinstalls it. yum history undo also attempts to downgrade all updated packages to their previous versions, if the older packages are still available.

Use the following procedure to repeat a selected transaction or the last transaction using yum.

Procedure

  • To repeat a particular transaction, use:

    # yum history redo transactionID

    Replace transactionID with the ID of the transaction.

  • To repeat the last transaction, use:

    # yum history redo last

Note that the yum history redo command only repeats the steps that were performed during the transaction.

yum commands allow you to filter the results by appending one or more glob expressions as arguments. You have to escape global expressions when passing them as arguments to the yum command.

Procedure

To ensure global expressions are passed to yum as intended, use one of the following methods:

  • Double-quote or single-quote the entire global expression.

    # yum provides "*/file-name"

    Replace file-name with the name of the file.

  • Escape the wildcard characters by preceding them with a backslash (\) character.

    # yum provides \*/file-name

    Replace file-name with the name of the file.

The configuration information for yum and related utilities are stored in the /etc/yum.conf file. This file contains one or more [repository] sections, which allow you to set repository-specific options.

It is recommended to define individual repositories in new or existing .repo files in the /etc/yum.repos.d/ directory.

Note that the values you define in individual [repository] sections of the /etc/yum.conf file override values set in the [main] section.

The following section describes how to:

  • Set [repository] options.
  • Add a yum repository.
  • Enable a yum repository.
  • Disable a yum repository.

The /etc/yum.conf configuration file contains the [repository] sections, where repository is a unique repository ID. The [repository] sections allows you to define individual yum repositories.

Do not give custom repositories names used by the Red Hat repositories to avoid conflicts.

For a complete list of available [repository] options, see the [repository] OPTIONS section of the yum.conf(5) manual page.

Procedure

To define a new repository, you can:

  • Add a [repository] section to the /etc/yum.conf file.
  • Add a [repository] section to a .repo file in the /etc/yum.repos.d/ directory.

    +

yum repositories commonly provide their own .repo file.

It is recommended to define your repositories in a .repo file instead of /etc/yum.conf as all files with the .repo file extension in this directory are read by yum.

  • To add a repository to your system and enable it, use:

    # yum-config-manager --add-repo repository_URL

    Replace repository_url with URL pointing to the repository.

Obtaining and installing software packages from unverified or untrusted sources other than Red Hat certificate-based Content Delivery Network (CDN) constitutes a potential security risk, and could lead to security, stability, compatibility, and maintainability issues.

Once you added a `yum`repository to your system, enable it to ensure installation and updates.

Procedure

  • To enable a repository, use:

    # yum-config-manager --enable repositoryID

    Replace repositoryID with the unique repository ID.

    To list available repository IDs, see Listing packages with yum.

Disable a specific YUM repository to prevent particular packages from installation or update.

Procedure

  • To disable a yum repository, use:

    # yum-config-manager --disable repositoryID

    Replace repositoryID with the unique repository ID.

    To list available repository IDs, see Listing packages with yum.

The configuration information for yum and related utilities are stored in the /etc/yum.conf file. This file contains one mandatory [main] section, which enables you to set yum options that have global effect.

The following section describes how to:

  • View the current yum configurations.
  • Set yum [main] options.
  • Use yum plug-ins.

Use the following procedure to view the current yum configurations.

Procedure

  • To display the current values of global yum options specified in the [main] section of the /etc/yum.conf file, use:

    # yum config-manager --dump

The /etc/yum.conf configuration file contains one [main] section. The key-value pairs in this section affect how yum operates and treats repositories.

You can add additional options under the [main] section heading in /etc/yum.conf.

For a complete list of available [main] options, see the [main] OPTIONS section of the yum.conf(5) manual page.

yum provides plug-ins that extend and enhance its operations. Certain plug-ins are installed by default.

The following section describes how to enable, configure, and disable yum plug-ins.

Procedure

The plug-in configuration files always contain a [main] section where the enabled= option controls whether the plug-in is enabled when you run yum commands. If this option is missing, you can add it manually to the file.

Every installed plug-in has its own configuration file in the /etc/dnf/plugins/ directory. You can enable or disable plug-in specific options in these files.

The following procedure describes how to disable or enable all YUM plug-ins, disable all plug-ins for a particular command, or certain YUM plug-ins for a single command.

+

Procedure

  • To enable all yum plug-ins:

    1. Ensure a line beginning with plugins= is present in the [main] section of the /etc/yum.conf file.
    2. Set the value of plugins= to 1.

      plugins=1

  • To disable all yum plug-ins:

    1. Ensure a line beginning with plugins= is present in the [main] section of the /etc/yum.conf file.
    2. Set the value of plugins= to 0.

      plugins=0

      Disabling all plug-ins is not advised. Certain plug-ins provide important yum services. In particular, the product-id and subscription-manager plug-ins provide support for the certificate-based Content Delivery Network (CDN). Disabling plug-ins globally is provided as a convenience option, and is advisable only when diagnosing a potential problem with yum.

  • To disable all yum plug-ins for a particular command, append --noplugins option to the command.

    # yum --noplugins update

  • To disable certain yum plug-ins for a single command, append --disableplugin=plugin-name option to the command.

    # yum update --disableplugin=plugin-name

    Replace plugin-name with the name of the plug-in.

Última postagem

Tag