This is for redhat/fedora not Ubuntu. but it may be helpful.
When I need geoIP, I have to install some of these packages.
geoipupdate.x86_64 : Update GeoIP2 binary databases from MaxMind
geoipupdate-cron.noarch : Cron job to do weekly updates of GeoIP databases
golang-github-oschwald-geoip2-devel.noarch : Unofficial MaxMind GeoIP2 Reader for Go
knot-module-geoip.x86_64 : geoip module for Knot DNS
opensips-mmgeoip.x86_64 : Wrapper for the MaxMind GeoIP API
perl-GeoIP2.noarch : Perl API for MaxMind's GeoIP2 web services and databases
perl-GeoIP2-tests.noarch : Tests for perl-GeoIP2
python-geoip2-doc.noarch : Documentation for python-geoip2
python3-GeoIP.x86_64 : Python bindings for the GeoIP geographical lookup libraries
python3-geoip2.noarch : MaxMind GeoIP2 API
python3-pygeoip.noarch : Pure Python GeoIP API
syslog-ng-geoip.x86_64 : GeoIP support for syslog-ng
uwsgi-plugin-geoip.x86_64 : uWSGI - Plugin for GeoIP support
================================================= Name Matched: geoip ==================================================
GeoIP.i686 : Library for country/city/organization to IP address or hostname mapping
GeoIP.x86_64 : Library for country/city/organization to IP address or hostname mapping
GeoIP-GeoLite-data.noarch : Free GeoLite IP geolocation country database
GeoIP-GeoLite-data-extra.noarch : Free GeoLite IP geolocation databases
It looks like you need the perl ones. Although in Ubuntu, they are likely named slightly differently.