How To Install dos2unix on CentOS 8

dos2unix is Text file format converters

Introduction

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

What is dos2unix

Convert text files with DOS or Mac line endings to Unix line endings and vice versa.

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

Install dos2unix 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 dos2unix using dnf by running the following command:

sudo dnf -y install dos2unix

Install dos2unix 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 dos2unix using yum by running the following command:

sudo yum -y install dos2unix

How To Uninstall dos2unix on CentOS 8

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

sudo dnf remove dos2unix

dos2unix Package Contents on CentOS 8

/usr/bin/dos2unix
/usr/bin/mac2unix
/usr/bin/unix2dos
/usr/bin/unix2mac
/usr/lib/.build-id
/usr/lib/.build-id/1a
/usr/lib/.build-id/1a/f3571dab27427d1af2783da47ea9c28d07930f
/usr/lib/.build-id/a5
/usr/lib/.build-id/a5/ff15c710a5914f5192f1e54b98d05ea29215f0
/usr/share/doc/dos2unix
/usr/share/doc/dos2unix/COPYING.txt
/usr/share/doc/dos2unix/ChangeLog.txt
/usr/share/doc/dos2unix/NEWS.txt
/usr/share/doc/dos2unix/README.txt
/usr/share/doc/dos2unix/TODO.txt
/usr/share/doc/dos2unix/dos2unix.htm
/usr/share/locale/da/LC_MESSAGES/dos2unix.mo
/usr/share/locale/de/LC_MESSAGES/dos2unix.mo
/usr/share/locale/eo/LC_MESSAGES/dos2unix.mo
/usr/share/locale/es/LC_MESSAGES/dos2unix.mo
/usr/share/locale/fr/LC_MESSAGES/dos2unix.mo
/usr/share/locale/hu/LC_MESSAGES/dos2unix.mo
/usr/share/locale/ja/LC_MESSAGES/dos2unix.mo
/usr/share/locale/nb/LC_MESSAGES/dos2unix.mo
/usr/share/locale/nl/LC_MESSAGES/dos2unix.mo
/usr/share/locale/pl/LC_MESSAGES/dos2unix.mo
/usr/share/locale/pt_BR/LC_MESSAGES/dos2unix.mo
/usr/share/locale/ru/LC_MESSAGES/dos2unix.mo
/usr/share/locale/sr/LC_MESSAGES/dos2unix.mo
/usr/share/locale/sv/LC_MESSAGES/dos2unix.mo
/usr/share/locale/uk/LC_MESSAGES/dos2unix.mo
/usr/share/locale/vi/LC_MESSAGES/dos2unix.mo
/usr/share/locale/zh_CN/LC_MESSAGES/dos2unix.mo
/usr/share/locale/zh_TW/LC_MESSAGES/dos2unix.mo
/usr/share/man/de/man1/dos2unix.1.gz
/usr/share/man/de/man1/mac2unix.1.gz
/usr/share/man/de/man1/unix2dos.1.gz
/usr/share/man/de/man1/unix2mac.1.gz
/usr/share/man/es/man1/dos2unix.1.gz
/usr/share/man/es/man1/mac2unix.1.gz
/usr/share/man/es/man1/unix2dos.1.gz
/usr/share/man/es/man1/unix2mac.1.gz
/usr/share/man/fr/man1/dos2unix.1.gz
/usr/share/man/fr/man1/mac2unix.1.gz
/usr/share/man/fr/man1/unix2dos.1.gz
/usr/share/man/fr/man1/unix2mac.1.gz
/usr/share/man/man1/dos2unix.1.gz
/usr/share/man/man1/mac2unix.1.gz
/usr/share/man/man1/unix2dos.1.gz
/usr/share/man/man1/unix2mac.1.gz
/usr/share/man/nl/man1/dos2unix.1.gz
/usr/share/man/nl/man1/mac2unix.1.gz
/usr/share/man/nl/man1/unix2dos.1.gz
/usr/share/man/nl/man1/unix2mac.1.gz
/usr/share/man/pl/man1/dos2unix.1.gz
/usr/share/man/pl/man1/mac2unix.1.gz
/usr/share/man/pl/man1/unix2dos.1.gz
/usr/share/man/pl/man1/unix2mac.1.gz
/usr/share/man/pt_BR/man1/dos2unix.1.gz
/usr/share/man/pt_BR/man1/mac2unix.1.gz
/usr/share/man/pt_BR/man1/unix2dos.1.gz
/usr/share/man/pt_BR/man1/unix2mac.1.gz
/usr/share/man/sv/man1/dos2unix.1.gz
/usr/share/man/sv/man1/mac2unix.1.gz
/usr/share/man/sv/man1/unix2dos.1.gz
/usr/share/man/sv/man1/unix2mac.1.gz
/usr/share/man/uk/man1/dos2unix.1.gz
/usr/share/man/uk/man1/mac2unix.1.gz
/usr/share/man/uk/man1/unix2dos.1.gz
/usr/share/man/uk/man1/unix2mac.1.gz
/usr/share/man/zh_CN/man1/dos2unix.1.gz
/usr/share/man/zh_CN/man1/mac2unix.1.gz
/usr/share/man/zh_CN/man1/unix2dos.1.gz
/usr/share/man/zh_CN/man1/unix2mac.1.gz

References

Summary

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