How to Freeze a .deb Package on Debian-Based Systems (and Thaw It Out Later) and Why?

Hello beautiful peoples!


So, what is a .deb package? Think of it as a zipped box with a program inside, plus a note telling your system where to put everything and what else it needs to work. Debian, Ubuntu, Mint and friends all use them, and apt is the delivery guy that fetches new boxes and swaps them for the old ones.

Most of the time that’s great. Sometimes (rarely) it’s a disaster. A new version can change the config format, drop a feature you rely on, or migrate your data in a way that can’t be rolled back. Jellyfin is a good example, because a major release can touch your database and there’s no going back. Other cases are a kernel that breaks your driver, or a database server you don’t want jumping to a new major version at 3 AM.

That’s when you freeze the package. apt calls it “hold”, and it keeps the package out of your regular upgrades until you say otherwise. Here is how to do it, using jellyfin and jellyfin-web as the guinea pigs::

You can freeze one package OR multiple.

# apt-mark hold freeze jellyfin and jellyfin-web
sudo apt-mark hold jellyfin jellyfin-web

You can list the currently frozen packages.

# Check what is currently frozen
apt-mark showhold

You can defrost them.

# Defrost packages jellyfin and jellyfin-web using apt-mark unhold
sudo apt-mark unhold jellyfin jellyfin-web

After the freeze, apt upgrade will skip those packages and tell you they were “kept back”. That’s how you know it works. Just remember a frozen package doesn’t get security fixes either, so don’t leave it on ice forever. After unhold, run your usual upgrade routine to install the latest and greatest.

I hope this helps!

Thank you for your attention to this matter.

Catch you on the flip side,

AndrzejL

Avatar photo

AndrzejL

“Some men just want to watch the world burn.”

Leave a Reply

Your email address will not be published. Required fields are marked *