I noticed recently that a few web sites are miscategorising my ISP's static IP as being in the wrong country. I knew it was a recent reallocation of a new block and suspected the web sites were using a stale version of a GeoIP database - probably MaxMind's GeoLite v1 offering.
If you see stuff like this while surfing the web, your IP is probably in the same boat:
As I also run a few servers which themselves use the GeoIP tool (with
geoipupdate) I wondered about how to update to the latest version. Sure enough, with the old v2 of geoipupdate I was using, the databases were definitely not available (and HTTP error codes were being returned when I tried to run an update).
When I started Googling in more detail, I discovered MaxMind has fully discontinued and removed the GeoLite databases. Yowzer.
But no matter! GeoLite2 is now available from the MaxMind Developers site - you can download the installer to suit your platform from the GeoIP Update page. On most of my servers, I only had to
--force install the RPM, as yum was requesting to also uninstall ProFTPd (?!), which I wasn't impressed by. On a couple of CentOS 7 servers, it complained about file conflicts:
a yum uninstall of the existing package it threatened to uninstall
dhclient and some
bind libraries, equally unimpressive. So let's not disturb the peace...
On one server, I noted problems updating due to file conflicts:
user@server: /home/user# rpm -i --replacepkgs geoipupdate_4.0.3_linux_amd64.rpm file /etc/GeoIP.conf from install of geoipupdate-4.0.3-1.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64 file /usr/bin/geoipupdate from install of geoipupdate-4.0.3-1.x86_64 conflicts with file from package GeoIP-1.5.0-13.el7.x86_64
In this case,
rpm -Uvh --replacefiles geoipupdate_4.0.3_linux_amd64.rpm worked flawlessly to replace (effectively update) the package files with the new installer's contents.
geoipupdate -v Using config file /etc/GeoIP.conf Using database directory /usr/share/GeoIP Acquired lock file lock (/usr/share/GeoIP/.geoipupdate.lock) Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-Country Not calculating MD5 sum as file does not exist: /usr/share/GeoIP/GeoLite2-Country.mmdb Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-Country/update?db_md5=00000000000000000000000000000000 Updated /usr/share/GeoIP/GeoLite2-Country.mmdb Performing get filename request to https://updates.maxmind.com/app/update_getfilename?product_id=GeoLite2-City Not calculating MD5 sum as file does not exist: /usr/share/GeoIP/GeoLite2-City.mmdb Performing update request to https://updates.maxmind.com/geoip/databases/GeoLite2-City/update?db_md5=00000000000000000000000000000000 Updated /usr/share/GeoIP/GeoLite2-City.mmdb
Always worth backing up the old binary and config just in case, but for me it was unnecessary. Verify the install afterwards with
geoipupdate -V, then run it with
geoipupdate -v and all should come good.