Monit 5.0.1: 2 Errors during installation

I encountered following error while running ./configure for Monit 5.0.1:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking whether gcc needs -traditional... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking for flex... no
checking for lex... no
configure: error: monit requires flex, not lex

So lets have a look at what flex is.
And install it.

1
apt-get install flex

This brought me to

1
2
3
4
5
...
checking for bison... no
checking for byacc... no
checking for yacc... no
configure: error: monit requires bison, byacc or yacc

So lets have a look at what bison, byacc and yacc are.
And install one of them. I decided to install bison

1
apt-get install bison

Works fine now.