How do I install gawk 4.0.1 or later on ubuntu 12.04?

Your suggestions would be appreciated!!


First of all, note the information in the following question:

This is an approach to build the Quantal (12.10) 4.0.1 version of gawk on 12.04 as a package. It applies to almost all packages you want to backport from a newer Ubuntu release to the one you're using. Most of the times it just builds cleanly. This one does.

  1. Install some basic package build tools:

    sudo apt-get install devscripts build-essential
    sudo apt-get build-dep gawk
  2. Install the key of the developer (example key!):

    gpg --keyserver keyserver.ubuntu.com --recv-key B6897E7B

    This key identifier should be replaced by the error output of the dget command below.

  3. Make the devscripts use your keyring too, as per Added key, but dget still shows “gpg: Can't check signature: public key not found":

    echo 'DSCVERIFY_KEYRINGS="/etc/apt/trusted.gpg:~/.gnupg/pubring.gpg"' >> ~/.devscripts
  4. Download the source package (.dsc file link from gawk package page in the sidebar):

    dget http://archive.ubuntu.com/ubuntu/pool/main/g/gawk/gawk_4.0.1+dfsg-2.dsc
  5. cd into it:

    cd gawk-4.0.1+dfsg/
  6. First attempt to build (fails possibly):

    debuild -uc -us

    if fails, relevant output with dpkg-checkbuilddeps: Unmet build dependencies (below is an example!):

    Unmet build dependencies: bison libreadline-dev libsigsegv-dev
  7. Install the additional build dependencies you still need at this point. Example:

    sudo apt-get install bison libreadline-dev libsigsegv-dev
  8. Retry building (should build fine now!):

    debuild -uc -us
  9. cd back into the upper directory:

    cd ..
  10. Find your package there:

    ls -al *.deb
  11. Install it:

    sudo dpkg -i gawk_4.0.1+dfsg-2_amd64.deb
  12. Enjoy!

In case you don't want to bother compiling this stuff, you still have two options:


I've uploaded this on my PPA (waiting to be built at this moment) for your convenience.

Manual installation of Quantal binary package

  1. Download the appropriate .deb file from the packages.ubuntu.com page, e.g. http://nl.archive.ubuntu.com/ubuntu/pool/main/g/gawk/gawk_4.0.1+dfsg-2_amd64.deb

  2. Install it manually:

    sudo dpkg -i gawk_4.0.1+dfsg-2_amd64.deb
| improve this answer | |

gertvdiijk's answer is probably right but I couldn't figure out what to do. I found:


has a PPA for Gnu Awk 4.0:

To get it from there you might want to execute:

apt-get install python-software-properties
add-apt-repository ppa:schot/gawk
apt-get update
apt-get install gawk

The link What are PPAs and how do I use them? was not directly helpful for me because it was only a link and did not have detailed instructions on what to really do given Ubuntu 12.04 LTS - I had to do a few trial and error attempts before I got to the four lines above.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.