Skip to content

Instantly share code, notes, and snippets.

@claudiobizzotto
Last active July 5, 2018 20:13
Show Gist options
  • Save claudiobizzotto/0fde9eb3c4014048b0a181982759b2f8 to your computer and use it in GitHub Desktop.
Save claudiobizzotto/0fde9eb3c4014048b0a181982759b2f8 to your computer and use it in GitHub Desktop.
Install Expect on Ubuntu 16.04

http://expect.sourceforge.net/

I've just tried this on a 16.04, but it should work on older versions of Ubuntu as well.

(1) Download and install ActiveTcl Free Community Edition

http://www.activestate.com/activetcl/downloads

Download and extract the files, then cd into the extracted directory and run ./install.sh (with root permissions).

Follow the installation instructions and put everything under the default directory (/opt).

(2) Download Expect

https://sourceforge.net/projects/expect/files/Expect/

Extract the contents into /opt.

(3) Configure, build, install Expect

From the installation directory (example /opt/expect5.45/), run the following commands:

$ sudo ./configure \
--with-tcl=/opt/ActiveTcl-8.6/lib/tcl8.6 \
--with-tclinclude=/opt/ActiveTcl-8.6/include/tcl8.6 \
--with-tk=/opt/ActiveTcl-8.6/lib/tcl8.6 \
--with-tkinclude=/opt/ActiveTcl-8.6/include/tcl8.6
$ sudo make && sudo make install

To have the final executable globally available, create a symlink for it:

$ sudo ln -s /opt/expect5.45/expect /usr/bin/expect
@betsalel-williamson
Copy link

betsalel-williamson commented Jul 5, 2018

On ubuntu 16 I tried to install, but the error it gave was:

checking for correct TEA configuration... ok (TEA 3.9)
configure: configuring expect 5.45.4
checking for Tcl configuration... configure: error: /opt/ActiveTcl-8.6/lib/tcl8.6/ directory doesn't contain tclConfig.sh

I edited this to run and was able to proceed with the install.

sudo ./configure \
--with-tcl=/opt/ActiveTcl-8.6/lib \
--with-tclinclude=/opt/ActiveTcl-8.6/include \
--with-tk=/opt/ActiveTcl-8.6/lib/tcl8.6 \
--with-tkinclude=/opt/ActiveTcl-8.6/include/tcl8.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment