When apt installs something older than the website says is current, I do not guess. I ask it.
apt policy nginx
The output has an Installed line, a Candidate line and a table of every version apt knows about. Next to each version is the repository it lives in, with a priority number. The Candidate is what apt install would pick.
This answers questions that otherwise eat an evening. Is the package not installed at all, or just not found? Is a newer version sitting in a PPA that I have disabled? Did the security pocket get something the main pocket did not? You see it in one screen.
Example: you read that a tool is at version 2.x, but Ubuntu 24.04 gives you 1.x. apt policy shows the 1.x candidate and that nothing newer exists in your enabled sources. That is not a bug. Ubuntu freezes versions per release and only patches them.
I also use it to check whether a PPA is overriding the Ubuntu version. The priority numbers show which source wins.
Caveat: it only knows what your last apt update fetched. Run that first, or you are reading old data.
Further reading: apt(8) man page (Ubuntu 24.04), On this site: apt autoremove –purge also deletes the leftover config files, On this site: apt changelog shows why a package wants to update