Install Geo::IP Perl Module on Debian
This little post will guide you how to quickly install the MaxMind Geo::IP Perl Module that has different usages as shown in other posts. This module should be faster than the other MaxMind perl module (Geo::IP::PurePerl) but it will require to have the GeoIP C library installed in order to be compiled.
So first we will need to install the GeoIP C library (that includes also the free GeoLite Country database). Luckily this is available in the Debian repositories so we can simply install it using:
apt-get install libgeoip1 libgeoip-devNext, to install the GeoIP perl module, we need to download the perl module locally from MaxMind or from CPAN.
The latest version available at the time I wrote this post is Geo-IP-1.27, but you should get the latest version available. Uncompress it and compile it as any perl module:
perl Makefile.PL
make
make test
make installFor other Linux distributions you will have to use the same steps (first install the GeoIP C library and then download and compile the perl module).
Note: if you are using Centos4 then you can skip all these steps as they have packaged the perl module in the “extras” repository so you can install it by simply running:
up2date perl-Geo-IP
>

20th May 2007, 06:32
[...] First, we have to install the GeoIP Perl module. I found instructions for Debian here. I provide the steps for FreeBSD below (this also installs GeoIP as a dependency of the Perl module): [root@asterix ~]# cd /usr/ports/net/p5-Geo-IP [root@asterix /usr/ports/net/p5-Geo-IP]# make install clean [root@asterix /usr/ports/net/p5-Geo-IP]# pkg_info -xL p5-Geo-IP Information for p5-Geo-IP-1.27_1: [...]
13th April 2008, 16:06
to install a specific version (i.e. 1.27) of the Geo::IP perl module you can just use the CPAN shell as follows:
At the linux shell prompt $ type in:
$ sudo perl -MCPAN -e shell
Then at the CPAN prompt cpan[0]> type in the following:
install TJMATHER/Geo-IP-1.27.tar.gz
This will achieve the same thing as the manual build describe above.
HTH
lblogic
15th September 2008, 22:57
On Ubuntu 8 you can also install the GeoIP perl library from a package repository:
apt-get install libgeo-ip-perl
Keith
30th September 2008, 06:32
To leftbrainlogic.com
THANKS – I followed your instructions and it worked for me!
3rd February 2009, 01:49
[...] will significanly improve the performance since DNS lookups will generally take a long time. Using this tutorial, install the GeoIP [...]
20th August 2009, 11:57
The debian way would probably be something like this:
wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.27.tar.gz
tar xvfz Geo-IP-1.27.tar.gz
cd Geo-IP-1.27
dh-make-perl
dpkg-buildpackage -b
dpkg -i ../libgeo-ip-perl_1.27-1_i386.deb
4th May 2010, 06:15
[...] url : here] For other linux distribution : 1. Install Geo::IP Perl Module on Debian 2. [...]
19th December 2010, 09:55
[...] How to set up geography-related plug-ins for AWStats. Install Geo::IP Perl Module on Debian [...]