How To Install diffutils on CentOS 8

diffutils is A GNU collection of diff utilities

Introduction

In this tutorial we learn how to install diffutils on CentOS 8.

What is diffutils

Diffutils includes four utilities compares two files and shows the differences, line by line. The cmp command shows the offset and line numbers where two files differ, or cmp can show the characters that differ between the two files. The diff3 command shows the differences between three files. Diff3 can be used when two people have made independent changes to a common original; diff3 can produce a merged file that contains both sets of changes and warnings about conflicts. The sdiff command can be used to merge two files interactively. Install diffutils if you need to compare text files.

We can use yum or dnf to install diffutils on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install diffutils.

Install diffutils on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install diffutils using dnf by running the following command:

sudo dnf -y install diffutils

Install diffutils on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install diffutils using yum by running the following command:

sudo yum -y install diffutils

How To Uninstall diffutils on CentOS 8

To uninstall only the diffutils package we can use the following command:

sudo dnf remove diffutils

diffutils Package Contents on CentOS 8

/usr/bin/cmp
/usr/bin/diff
/usr/bin/diff3
/usr/bin/sdiff
/usr/lib/.build-id
/usr/lib/.build-id/8f
/usr/lib/.build-id/8f/487f40b58c8b761274e139cf7839e18024711f
/usr/lib/.build-id/a0
/usr/lib/.build-id/a0/a1a1c91cfe0a847a7990ccbf67f8b2b3e8f5a5
/usr/lib/.build-id/b1
/usr/lib/.build-id/b1/5ce51ea962d95d9f60617c335af39f3fb0e0a6
/usr/lib/.build-id/fd
/usr/lib/.build-id/fd/294b26782b6a0e2009ac883bfa0e250e5f2141
/usr/share/doc/diffutils
/usr/share/doc/diffutils/NEWS
/usr/share/doc/diffutils/README
/usr/share/info/diffutils.info.gz
/usr/share/licenses/diffutils
/usr/share/licenses/diffutils/COPYING
/usr/share/locale/ca/LC_MESSAGES/diffutils.mo
/usr/share/locale/cs/LC_MESSAGES/diffutils.mo
/usr/share/locale/da/LC_MESSAGES/diffutils.mo
/usr/share/locale/de/LC_MESSAGES/diffutils.mo
/usr/share/locale/el/LC_MESSAGES/diffutils.mo
/usr/share/locale/eo/LC_MESSAGES/diffutils.mo
/usr/share/locale/es/LC_MESSAGES/diffutils.mo
/usr/share/locale/fi/LC_MESSAGES/diffutils.mo
/usr/share/locale/fr/LC_MESSAGES/diffutils.mo
/usr/share/locale/ga/LC_MESSAGES/diffutils.mo
/usr/share/locale/gl/LC_MESSAGES/diffutils.mo
/usr/share/locale/he/LC_MESSAGES/diffutils.mo
/usr/share/locale/hr/LC_MESSAGES/diffutils.mo
/usr/share/locale/hu/LC_MESSAGES/diffutils.mo
/usr/share/locale/id/LC_MESSAGES/diffutils.mo
/usr/share/locale/it/LC_MESSAGES/diffutils.mo
/usr/share/locale/ja/LC_MESSAGES/diffutils.mo
/usr/share/locale/lv/LC_MESSAGES/diffutils.mo
/usr/share/locale/ms/LC_MESSAGES/diffutils.mo
/usr/share/locale/nb/LC_MESSAGES/diffutils.mo
/usr/share/locale/nl/LC_MESSAGES/diffutils.mo
/usr/share/locale/pl/LC_MESSAGES/diffutils.mo
/usr/share/locale/pt_BR/LC_MESSAGES/diffutils.mo
/usr/share/locale/ro/LC_MESSAGES/diffutils.mo
/usr/share/locale/ru/LC_MESSAGES/diffutils.mo
/usr/share/locale/sr/LC_MESSAGES/diffutils.mo
/usr/share/locale/sv/LC_MESSAGES/diffutils.mo
/usr/share/locale/tr/LC_MESSAGES/diffutils.mo
/usr/share/locale/uk/LC_MESSAGES/diffutils.mo
/usr/share/locale/vi/LC_MESSAGES/diffutils.mo
/usr/share/locale/zh_CN/LC_MESSAGES/diffutils.mo
/usr/share/locale/zh_TW/LC_MESSAGES/diffutils.mo
/usr/share/man/man1/cmp.1.gz
/usr/share/man/man1/diff.1.gz
/usr/share/man/man1/diff3.1.gz
/usr/share/man/man1/sdiff.1.gz

References

Summary

In this tutorial we learn how to install diffutils on CentOS 8 using yum and dnf.