Skip to main content

Linux command: dnf

DNF is a software package manager

Notes while using DNF — software package manager — on Fedora Workstation 30.

dnf Cheat Sheet

dnf install -y packagename1 packagename2
dnf reinstall -y packagename
dnf remove -y packagename
dnf search packagename

Examples

Count number of packages

[tuyen@g73jh ~]$ dnf list | wc -l
58683
[tuyen@g73jh ~]$

Count number of installed packages

[tuyen@g73jh ~]$ dnf list --installed | wc -l
1802
[tuyen@g73jh ~]$ 

Search for 'dynamips' package

[tuyen@g73jh ~]$ dnf search dynamips
Last metadata expiration check: 0:24:44 ago on Wed 18 Sep 2019 10:51:38 AM +07.
======================== Name Exactly Matched: dynamips ========================
dynamips.x86_64 : Cisco Router Emulator
[tuyen@g73jh ~]$ 

Check if 'bison' package is installed

[tuyen@g73jh ~]$ dnf list --installed | grep bison
[tuyen@g73jh ~]$

Check if 'gcc' package is installed

[tuyen@g73jh ~]$ dnf list --installed | grep gcc
gcc.x86_64                                        9.2.1-1.fc30                        @updates                    
gcc-gdb-plugin.x86_64                             9.2.1-1.fc30                        @updates                    
libgcc.i686                                       9.2.1-1.fc30                        @updates                    
libgcc.x86_64                                     9.2.1-1.fc30                        @updates                    
[tuyen@g73jh ~]$ 

Popular posts from this blog

Delete files older than 365 days

I must delete IIS *.log files in  older than 365 days. D:\Logs | -W3SVC1 -W3SVC2 -... -W3SVC33 daily-delete-logfiles-older-than-365-days.cmd :: Daily delete log files older than 365 days :: Created on: 20161120 :: Created by: :: Last modified on: :: Last modified by: :: History: SET DIRLOG=E:\_scripts\Logs\ :: Echo @path to test first :: FORFILES /P D:\Logs /S /M *.log /D -365 /C "cmd /c echo @path @fdate" :: Delete files ECHO "Begin" >> %dirlog%daily-delete-logfiles.log DATE /T >> %dirlog%daily-delete-logfiles.log TIME /T >> %dirlog%daily-delete-logfiles.log FORFILES /P D:\Logs /S /M *.log /D -365 /C "cmd /c del @path" >> %dirlog%daily-delete-logfiles.log ECHO "Finished" >> %dirlog%daily-delete-logfiles.log DATE /T >> %dirlog%daily-delete-logfiles.log TIME /T >> %dirlog%daily-delete-logfiles.log :: END of script /P : Path to folder /S: recurse into subdirectories /M *.l...

SoloLearn: Learn to Code for Free!

Got a minute? You can learn to code anywhere, anytime you can with your smartphone using Sololearn.

Data Recovery Softwares

Follow 3-2-1 backup rule so you do not need these data recovery softwares.