FOSS Linux published a tutorial about installing vnStat on Ubuntu 22.04.
How to install vnStat on Ubuntu 22.04
Right now, you should be able to install and use vnStat, on Ubuntu 22.04 system flawlessly. This article has exhaustively covered each step.
How to install vnStat on Ubuntu 22.04 | FOSS Linux