Compiling bash-4.1 on Ubuntu
From FVue
Here's how I'm compiling bash-4.1 on Ubuntu-10.04 (Lucid Lynx), with the latest patches:
Contents
Download
$ cd ~/src/bash $ wget http://ftp.gnu.org/gnu/bash/bash-4.1.tar.gz{,.sig} $ # Import public key of bash author, Chet Ramey $ wget -O- http://tiswww.case.edu/php/chet/gpgkey.asc | gpg --import $ # Verify signature $ gpg bash-4.1.tar.gz.sig $ # Download and verify patches and signatures $ for i in {1..999}; do > wget http://ftp.gnu.org/gnu/bash/bash-4.1-patches/bash41-$(printf "%03d" $i){,.sig} || break > gpg bash41-$(printf "%03d" $i).sig || exit > done $ # Untar bash $ tar xvzf bash-4.1.tar.gz $ # Apply patches $ cd bash-4.1 $ cat ../bash41-??? | patch -p0
If it's the first time you're compiling, you might need these additional packages:
sudo apt-get install bison # For yacc sudo apt-get install texinfo # For makeinfo
Compile
Choose if you want to:
- Replace the current version of bash
- Install alongside the current version of bash
Replace current version of bash
$ # Compile $ ./configure $ make $ sudo checkinstall $ # If /bin/bash is gone, symlink it to /usr/local/bin/bash $ [ -f /bin/bash ] || sudo ln -s /usr/local/bin/bash /bin/bash
Bash is now installed as /usr/local/bin/bash
.
Install alongside current version of bash
$ # Compile $ ./configure --prefix=/opt/bash-4 $ make $ make install
Bash is now installed as /opt/bash-4/bin/bash
.
See also
- Installing bash 4.0 alongside bash 3.x
- How to install bash-4 into a separate directory /opt/bash-4/bin/bash
- Download Page for bash_3.2-5ubuntu1_i386.deb on Intel x86 machines
- In case something goes wrong, here you can download the original bash-package and install it with
sudo dpkg -i <package>
Journal
20091127
If you receive warnings like this:
configure:1924: error: C compiler cannot create executables ... configure: exit 77
Make sure you have the latest version of the compiler installed:
sudo apt-get install libc6-dev g++ gcc
Advertisement