07. Installing packages with dependencies dnf

DNF Does Not stand For anything. It was created to solve longstanding problems with yum, such as dependency resolutions and interaction with online repositories. Furthermore, Yum's API is poorly documented, and after several bouts of poorly-managed refactoring, it has become difficult to keep the program slim and well-specified.

DNF has also improved on lower memory reduction and less automatic synchronization of metadata with respositories.

Actions

Here are five subcommands that you can use with dnf.

1) General

Here are some general commands about the dnf package itself.

--version
Check the version of DNF installed.
repolist
List all enabled repositories on your system. Add all at the end to view disabled repositories as well.
list
List all available packages on the repos and installed packages.

2) Searching

# dnf search vim
...
vim-minimal.x86_64 : A minimal version of the VIM editor
...

3) Query

To get information about a package

# dnf info vim
Name : vim-minimal Arch : x86_64 Epoch : 2 Version : 7.4.640 Release : 4.fc22 Size : 922 k Repo : @System Summary : A minimal version of the VIM editor URL : http://www.vim.org/ License : Vim Description : VIM (VIsual editor iMproved) is an updated and improved version of the : vi editor. Vi was the first real screen-based editor for UNIX, and is : still very popular. VIM improves on vi by adding new features: : multiple windows, multi-level undo, block highlighting and more. The : vim-minimal package includes a minimal version of VIM, which is : installed into /bin/vi for use when only the root partition is : present. NOTE: The online help is only available when the vim-common : package is installed. Available Packages Name : vim-minimal Arch : x86_64 Epoch : 2 Version : 7.4.827 Release : 1.fc22 Size : 465 k Repo : updates Summary : A minimal version of the VIM editor URL : http://www.vim.org/ License : Vim Description : VIM (VIsual editor iMproved) is an updated and improved version of the : vi editor. Vi was the first real screen-based editor for UNIX, and is : still very popular. VIM improves on vi by adding new features: : multiple windows, multi-level undo, block highlighting and more. The : vim-minimal package includes a minimal version of VIM, which is : installed into /bin/vi for use when only the root partition is : present. NOTE: The online help is only available when the vim-common : package is installed.

4) Installing

Instaling is similar to how it was done in yum.

# sudo dnf install vim-minimal

5) Upgrading/Updating

In dfn, upgrading and updating mean the same thing.

# Update just vim-minimal
# dnf update vim-minimal # Update all installed software
# dnf upgrade

Take your Linux skills to the next level!

Command Line Kung Fu

Take your Linux skills to the next level! Try Linux & UNIX

Command Line Kung Fu is packed with dozens of tips and practical real-world examples. You won't find theoretical examples in this book. The examples demonstrate how to solve actual problems. The tactics are easy to find, too. Each chapter covers a specific topic and groups related tips and examples together.

$ Check price
14.9914.99Amazon 4.5 logo(27+ reviews)

More Linux & UNIX resources

Want to avoid becoming a code monkey?

The Pragramatic Programmer

Want to avoid becoming a code monkey? Try Good Practice

The Pragmatic Programmer illustrates the best practices and major pitfalls of many different aspects of software development.Whether you're a new coder, an experienced programmer, or a manager responsible for software projects, use these lessons daily, and you'll quickly see improvements in personal productivity, accuracy, and job satisfaction.

$ Check price
49.9949.99Amazon 4.5 logo(338+ reviews)

More Good Practice resources

Ad