How To Install GeoIP on CentOS 8

In this tutorial we learn how to install GeoIP on CentOS 8. GeoIP is Library for country/city/organization to IP address or hostname mapping

Introduction

In this tutorial we learn how to install GeoIP on CentOS 8.

What is GeoIP

GeoIP is a C library that enables the user to find the country that any IP address or hostname originates from. It uses file based databases that can optionally be updated on a weekly basis by installing the geoipupdate-cron (IPv4) and/or geoipupdate-cron6 (IPv6) packages.

We can use yum or dnf to install GeoIP on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install GeoIP.

Install GeoIP on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install GeoIP using yum by running the following command:

sudo yum -y install GeoIP

Install GeoIP on CentOS 8 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install GeoIP using dnf by running the following command:

sudo dnf -y install GeoIP

How To Uninstall GeoIP on CentOS 8

To uninstall only the GeoIP package we can use the following command:

sudo dnf remove GeoIP

References

Summary

In this tutorial we learn how to install GeoIP on CentOS 8 using yum and dnf.