Dnf - switch from aptitude

I switch from debian to fedora and althogh reading wikis and mans etc. I get caught on dnf where I do not find answers…

When I use e.g. ‘dnf se nextcloud’ there is a lot of output - but I can’t see whether the package is installed or not (like aptitude search nextcloud would tell me). Is there a switch for it?
And for selection package I used something like ‘aptitude search nextcloud|grep ^i’ in the past for (only) seeing, what packages including ‘nextcloud’ are installed. How would this possible with dnf?
Is it possible to shorten the list of ‘dnf se’ only for the excatly matches (or the other possibilities)?

Thanking you in anticipation!



To query if a RPM package is installed or not, we can use rpm -qa | grep pkgname



Great, this helped a lot!
Thank you!



You don’t actually need to use grep there, try:

rpm -qa \*<string>\*

For example:

rpm -qa \*python\*

Of course, the man pages are your best source of information:

man dnf
man rpm

Man pages are a very good source, but honestly I almost always look for a nice example and just after I check what all the parameters are for. So here my hints:

hint rpm

# To install a package:
rpm -ivh <rpm>

# To remove a package:
rpm -e <package>

# To find what package installs a file:
rpm -qf </path/to/file>

# To find what files are installed by a package:
rpm -ql <package>
rpm -qpl <rpm>

# To find what packages require a package or file:
rpm -q --whatrequires <package>
rpm -q --whatrequires <file>

# To list all installed packages:
rpm -qa

hint does not seem to be a command in the Fedora repos, though. Where can one find this package? (dnf whatprovides '/usr/bin/hint' doesn’t return anything here on F34)

There’s really no shortage of docs on the web etc. about most commands. The man pages just tend to be the authoritative source of information (along with info docs).


It is not … no … but as I said examples bring me faster to the point as trail and fail with man pages. They are very well as you said no doubts.
About hint this is a script i found while learning bash. It was named cheat as cheat-sheet. I believe that I not cheat while looking up in my or others notes. So for learning bash and to see how the scripts work i made my own version based on an existing script.

Probably I need to develop the attitude to request adding more examples in the man and info pages.


For this, use dnf list nextcloud instead of dnf search nextcloud.


And dnf list "*nextcloud*" will list packages which include the given string (in this case, nextcloud) in their name and whether they are installed or not.


For online man pages, I’ve been finding https://www.mankier.com very useful.

  • It integrates examples from tldr.sh.
  • Command options are hyperlinked
  • It generates man pages from Fedora rawhide; this makes it a good choice for Fedora derived distributions. It has a github repo for holding extra man pages beyond what is in Fedora rawhide.
  • After you integrate it as a search engine for Firefox, you can type man rpm in the Firefox location and it will take you directly to the rpm man page.
  • See the about page for an explanation of how to use s for searching within a page.