Thanks for clarifying, and for curing my misunderstanding. Hmmm. Whatever the problem might be, it's none of the common causes: Wrong sources and non-Ubuntu packages. Kudos for doing things the right way and for staying on top of maintenance. Were it my system, I would run a 24.04 LiveUSB, enter the 'Try Ubuntu" environment, install cacti, and test if my customizations work in the updated environment. Knowing that answer will give you options to move forward,
Ubuntu Forums Code of Conduct