Install bison 2.7 in Ubuntu 14.04

Solution 1:

I installed last pkgs of bison (2.7.1) and libbison-dev (2.7.1) from Saucy and it worked like a charm.

wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb
wget http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb
dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb
dpkg -i bison_2.7.1.dfsg-1_amd64.deb

To prevent update manager from overwriting this package

apt-mark hold libbison-dev
apt-mark hold bison    

Done.

Solution 2:

Just give the package version also as follows:

apt-get install pkg=version

and you can get all the available versions using apt-cache showpkg bison

Solution 3:

You can install bison version 2.7 via linuxbrew. Once you have installed linuxbrew by:

ruby -e "$(wget -O- https://raw.github.com/Homebrew/linuxbrew/go/install)"

and adding the following to the bottom of .bashrc or .zshrc:

export PATH="$HOME/.linuxbrew/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/.linuxbrew/lib:$LD_LIBRARY_PATH"

You can install Bison 2.7!

brew install bison27

Homebrew is meant for macs, so it will yell at you for not using your Mac properly if you run brew doctor. As Macs already have Bison installed, it will refuse to finish the install. You can safely force it by doing:

brew link bison27 --force

And now check bison -V to see you are using Bison 2.7!

Solution 4:

bison2 (2:2.7.1.dfsg-1-ppa1) is available from my ppa here