Tente isto:
Abra um terminal
Pressione Ctrl + Alt + T
Execute:
sudo -i
nano /etc/apt/sources.list
No arquivo aberto, exclua seu conteúdo e coloque isso:
deb http://old-releases.ubuntu.com/ubuntu/ utopic main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ utopic main restricted
deb http://old-releases.ubuntu.com/ubuntu/ utopic-updates main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ utopic-updates main restricted
deb http://old-releases.ubuntu.com/ubuntu/ utopic universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ utopic universe multiverse
deb http://old-releases.ubuntu.com/ubuntu utopic-security main restricted
deb-src http://old-releases.ubuntu.com/ubuntu utopic-security main restricted
deb http://old-releases.ubuntu.com/ubuntu/ utopic-backports main restricted universe multiverse
Ctrl + O Salvar arquivo
Ctrl + X Fechar o Nano
Continue em execução:
apt-get update
apt-get dist-upgrade
apt-get install flex