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.
Install some basic package build tools:
sudo apt-get install devscripts build-essential
sudo apt-get build-dep gawk
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.
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
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
cd
into it:
cd gawk-4.0.1+dfsg/
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
Install the additional build dependencies you still need at this point. Example:
sudo apt-get install bison libreadline-dev libsigsegv-dev
Retry building (should build fine now!):
debuild -uc -us
cd
back into the upper directory:
cd ..
Find your package there:
ls -al *.deb
Install it:
sudo dpkg -i gawk_4.0.1+dfsg-2_amd64.deb
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.
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
Install it manually:
sudo dpkg -i gawk_4.0.1+dfsg-2_amd64.deb
gertvdiijk's answer is probably right but I couldn't figure out what to do. I found:
https://launchpad.net/~schot/+archive/ubuntu/gawk
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.