If you want to see what packages have updates available, use:dnf search <search-term>
This tutorial here provides examples for some of the common usage of the DNF command for installing, removing and managing software on your openEuler system.
Table of Contents
Update the system
dnf list <pakcage-name-or-expression>
Search for a package
As I have mentioned numerous time earlier that openEuler is based on CentOS. This means, like any distro in the Red Hat domain, it uses DNF package manager. So, first, look for a short info about the group.You can also install multiple packages in one command: sudo dnf install ./*.rpm
Remove a package
dnf download <package-name>
Now that you got a list of packages that matches the name you searched. Let’s see what that package is all about without installing it.sudo dnf remove <proper-package-name>
dnf check-update
dnf download --resolve <package-name>
DNF is a popular packager manager and you should not find any difficulties in using.DNF is a popular packager manager and you should not find any difficulties in using.DNF provides a solution to download a package and then install separately. First, download the single package using:Download a package and install it
dnf group info "Development Tools"
sudo dnf install <package1> <package2> --setopt=strict=0
--setopt=strict=0
flag to make sure that, issues like unavailable packages or broken dependencies affect the transaction. But if the skipped part are essential, you need to take care that afterwards.Like any other system, the first step in managing packages is to check whether the installed packages are up-to-date or not. Open a terminal and run the command:At the same time, to know a particular package is installed, replace all
with package name or expression:Now, to remove a package group, follow the same procedure, except specify group.sudo dnf autoremove
Install and remove a package group
dnf group list
dnf list all | less
If you are searching for a package for the first time after a gap, dnf need to update the cache. So, it may take a while to do that.sudo dnf update
🚧dnf info <proper-package-name>
sudo dnf install <proper-package-name>
This will download and install the mentioned package to your system.
sudo dnf group remove group-name
Common DNF commands at a glance
Description | Command |
---|---|
List installed packages | dnf list all |
Search for installed package | dnf list <search-term> |
Check for available updates | dnf check-update |
Update the system | sudo dnf update |
Update individual package | sudo dnf update <package-name> |
Search for a package in repository | dnf search <package-search-term> |
Get package information | dnf info <package-name> |
Download a package | dnf download <package-name> |
Download package with dependencies | dnf download –resolve <package-name> |
Install a package from repository | sudo dnf install <package-name> |
Install multiple packages | sudo dnf install <package1> <package2> –setopt=strict=0 |
Install a downloaded package | sudo dnf install <path-to-downloaded-file> |
Remove a package | sudo dnf remove <package-name> |
Remove unused dependencies and residual packages | sudo dnf autoremove |
List all package groups | dnf group list |
Get group information | dnf group info “Development Tools” |
Install a group packages | sudo dnf group install <group-name> |
Remove a package group | sudo dnf group remove <group-name> |