If your distribution is Ubuntu Lucid.
Test this:
Open a terminal,
Press Ctrl+Alt+T
Run it:
sudo -i
nano /etc/apt/sources.list
In the open file, delete the content and paste this:
## Uncomment the following two lines to fetch updated software from the network
deb http://old-releases.ubuntu.com/ubuntu lucid main restricted
deb-src http://old-releases.ubuntu.com/ubuntu lucid main restricted
## Uncomment the following two lines to fetch major bug fix updates produced
## after the final release of the distribution.
deb http://old-releases.ubuntu.com/ubuntu lucid-updates main restricted
deb-src http://old-releases.ubuntu.com/ubuntu lucid-updates main restricted
## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://old-releases.ubuntu.com/ubuntu lucid universe
deb-src http://old-releases.ubuntu.com/ubuntu lucid universe
deb http://old-releases.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://old-releases.ubuntu.com/ubuntu lucid-security main restricted
deb http://old-releases.ubuntu.com/ubuntu lucid-security universe
deb-src http://old-releases.ubuntu.com/ubuntu lucid-security universe
deb http://old-releases.ubuntu.com/ubuntu lucid multiverse
deb-src http://old-releases.ubuntu.com/ubuntu lucid multiverse
deb http://old-releases.ubuntu.com/ubuntu lucid-backports main restricted universe multiverse
Ctrl + O, save file. Ctrl + X, close nano.
Continue run in a terminal:
sudo -i
apt-get update
apt-get dist-upgrade
apt-get install flex bison
apt-get clean
If your distribution is not Ubuntu Lucid, change Lucid to appropriate name.
If none of this works
Download packages (Lucid):
http://mirrors.kernel.org/ubuntu/pool/main/b/bison/bison_2.4.1.dfsg-3_i386.deb (32 bit)
http://mirrors.kernel.org/ubuntu/pool/main/b/bison/bison_2.4.1.dfsg-3_amd64.deb (64 bit)
http://mirrors.kernel.org/ubuntu/pool/main/f/flex/flex_2.5.35-9_i386.deb (32 bit)
http://mirrors.kernel.org/ubuntu/pool/main/f/flex/flex_2.5.35-9_amd64.deb (64 bit)
And install them with:
sudo -i
cd /home/user/Downloads
dpkg -i *.deb
cat /etc/environment
andcat /etc/apt/apt.conf
. – muru Dec 07 '14 at 14:10