flex provides lex.

Install flex:

sudo apt-get install flex


In general, you can find a file in a package using the
packages.ubuntu.com site and typing the name of the file ("lex" in this...