Sometimes one package has to stay exactly as it is. A database version you have not tested against, a driver that finally works. The rest of the system can still update.
apt has a switch for this:
sudo apt-mark hold postgresql-16
apt-mark showhold
sudo apt-mark unhold postgresql-16
According to the man page, a held package is not automatically installed, upgraded or removed. showhold lists what you have pinned, which matters more than it sounds. A hold you forgot about is a security update you are quietly skipping.
The example uses PostgreSQL because that is a classic case, but any package name works. Use the real name from dpkg -l, not the name of the program.
Pair it with a habit: when you hold something, write down why. Future me never remembers.
My caveat: a hold does not expire, and apt will not nag you about it. If I set one, I put a reminder in my calendar to look at it again. Also, other packages that depend on a newer version can end up held back or refused, so read apt’s messages when it complains.
Further reading: apt-mark(8) man page (Ubuntu 24.04), On this site: apt changelog shows why a package wants to update, On this site: apt policy tells you which version you get and where it comes from