Forrest logo
back to the apt-mark tool

apt-mark:tldr:202d0

apt-mark: Hold a package at its current version and prevent updates to it.
$ sudo apt-mark hold ${package_name}
try on your machine

The command "sudo apt-mark hold ${package_name}" is used in Ubuntu-based Linux systems to put a certain package on hold, preventing it from being upgraded or removed by the apt package management system.

Here's a breakdown of the command:

  • "sudo" is short for "superuser do" and it allows the user to execute a command as the superuser or administrator.

  • "apt-mark" is a command-line tool in Ubuntu used to manipulate the dpkg package status flags. In this case, it is used to set or remove the hold flag for a package.

  • "hold" is one of the dpkg package status flags that can be set using the "apt-mark" command. When a package is put on hold, it will not be upgraded or removed automatically by apt.

  • "${package_name}" is a placeholder for the name of the package you want to put on hold. You need to replace it with the actual name of the package you want to hold.

By executing this command with the name of a package, you are instructing the system to prevent any updates or removals related to that particular package. This can be useful in scenarios where you want to keep a specific package at a certain version and prevent any automatic upgrades or modifications.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the apt-mark tool