How To Install expect on CentOS 8

expect is A program-script interaction and testing utility

Introduction

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

What is expect

Expect is a tcl application for automating and testing interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect makes it easy for a script to control another program and interact with it. This package contains expect and some scripts that use it.

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

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

sudo dnf -y install expect

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

sudo yum -y install expect

How To Uninstall expect on CentOS 8

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

sudo dnf remove expect

expect Package Contents on CentOS 8

/usr/bin/autoexpect
/usr/bin/dislocate
/usr/bin/expect
/usr/bin/ftp-rfc
/usr/bin/kibitz
/usr/bin/lpunlock
/usr/bin/mkpasswd
/usr/bin/passmass
/usr/bin/rftp
/usr/bin/rlogin-cwd
/usr/bin/timed-read
/usr/bin/timed-run
/usr/bin/unbuffer
/usr/bin/weather
/usr/bin/xkibitz
/usr/lib/.build-id
/usr/lib/.build-id/a8
/usr/lib/.build-id/a8/2e3e493f5b19ce2b220a46b36b850d52cf45e0
/usr/lib/.build-id/ed
/usr/lib/.build-id/ed/91748947bead1dfa59478fbe8bcb6ff6b35eda
/usr/lib64/libexpect.so
/usr/lib64/libexpect5.45.4.so
/usr/lib64/tcl8.6/expect5.45.4
/usr/lib64/tcl8.6/expect5.45.4/pkgIndex.tcl
/usr/share/doc/expect
/usr/share/doc/expect/FAQ
/usr/share/doc/expect/HISTORY
/usr/share/doc/expect/NEWS
/usr/share/doc/expect/README
/usr/share/man/man1/autoexpect.1.gz
/usr/share/man/man1/dislocate.1.gz
/usr/share/man/man1/expect.1.gz
/usr/share/man/man1/kibitz.1.gz
/usr/share/man/man1/mkpasswd.1.gz
/usr/share/man/man1/passmass.1.gz
/usr/share/man/man1/unbuffer.1.gz
/usr/share/man/man1/xkibitz.1.gz

References

Summary

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