sudo dnf update what does this do
- User
sudo dnf update
what does this do
- Assistant
sudo dnf update
what does this do
The command sudo dnf update is used to update the software packages on a system that uses the DNF package manager, which is common in Fedora, Red Hat, CentOS (from version 8 onwards), and similar Linux distributions.
Here is a breakdown of what the command does:
sudo: This stands for "superuser do." It allows you to run the dnf update command with administrative (root) privileges. This is necessary because updating software packages affects the entire system and typically requires higher-level permissions.
dnf: This is the DNF package manager command. DNF stands for "Dandified YUM" and is a modern replacement for the older YUM package manager. It is used to manage packages on certain Linux distributions.
update: This argument tells dnf to update all installed packages to their latest versions. The dnf update command will check for available updates for all installed packages, download them, and install them on your system.
When you run sudo dnf update, the following steps generally occur:
Repository Metadata Refresh: DNF will first update its repository metadata to get the latest information about available packages from the configured software repositories.
Dependency Resolution: DNF will determine the latest versions of all installed packages and check for dependencies.
Downloading Updates: The required updates will be downloaded from the repositories.
Installing Updates: The downloaded updates will be installed on your system.
Cleaning Up: DNF will clean up any temporary data and finish the update process.
For example:
$ sudo dnf update
[sudo] password for your_username:
Last metadata expiration check: 0:05:00 ago on Tue Oct 26 14:32:10 2021.
Dependencies resolved.
==================================================================================================
Package Arch Version Repository Size
==================================================================================================
Upgrading:
kernel x86_64 5.11.12-200.fc33 updates-testing 63 M
python37 x86_64 3.7.10-2.fc33 updates-testing 129 k
...
Transaction Summary
==================================================================================================
Upgrade 2 Packages
Total download size: 63 M
Is this ok [y/N]: y
You type y and press Enter to proceed with the update. DNF will download and install the updates, then clean up.
Keep in mind that updating a large number of packages or major system components (like the kernel) might require a restart of the system to take full effect.
Not yet included in a published release.