How To Install vnstat on Rocky Linux 8

In this tutorial we learn how to install vnstat on Rocky Linux 8. vnstat is Console-based network traffic monitor

Introduction

In this tutorial we learn how to install vnstat on Rocky Linux 8.

What is vnstat

vnStat is a console-based network traffic monitor that keeps a log of daily network traffic for the selected interface(s). vnStat isn’t a packet sniffer. The traffic information is analyzed from the /proc file-system, so vnStat can be used without root permissions. See the web-page for few ‘screenshots’.

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

Install vnstat on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install vnstat

Install vnstat on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install vnstat

How To Uninstall vnstat on Rocky Linux 8

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

sudo dnf remove vnstat

vnstat Package Contents on Rocky Linux 8

/etc/vnstat.conf
/run/vnstat
/usr/bin/vnstat
/usr/bin/vnstati
/usr/lib/.build-id
/usr/lib/.build-id/41
/usr/lib/.build-id/41/5bb13559f0515e1a3c9fd1f0d76595959149e9
/usr/lib/.build-id/84
/usr/lib/.build-id/84/ee29b5d516e40f7fc6a042f89c32327c0c063a
/usr/lib/.build-id/cd
/usr/lib/.build-id/cd/10f1fa422fb7731de9cb83fb41ea3c6b0f5395
/usr/lib/systemd/system/vnstat.service
/usr/lib/tmpfiles.d/vnstat.conf
/usr/sbin/vnstatd
/usr/share/doc/vnstat
/usr/share/doc/vnstat/CHANGES
/usr/share/doc/vnstat/FAQ
/usr/share/doc/vnstat/INSTALL
/usr/share/doc/vnstat/README
/usr/share/doc/vnstat/examples
/usr/share/doc/vnstat/examples/vnstat-json.cgi
/usr/share/doc/vnstat/examples/vnstat-json.php
/usr/share/doc/vnstat/examples/vnstat.cgi
/usr/share/licenses/vnstat
/usr/share/licenses/vnstat/COPYING
/usr/share/man/man1/vnstat.1.gz
/usr/share/man/man1/vnstati.1.gz
/usr/share/man/man5/vnstat.conf.5.gz
/usr/share/man/man8/vnstatd.8.gz
/var/lib/vnstat

References

Summary

In this tutorial we learn how to install vnstat on Rocky Linux 8 using yum and dnf.