• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

apt-mark: command not found

by admin

apt-mark is a command-line utility that is part of the apt package manager in Linux distributions that use the Debian package management system, such as Ubuntu and Debian itself. It allows you to mark packages as manually installed or automatically installed, and to list the packages that are currently marked as manually installed.

The apt package manager is responsible for installing, updating, and removing packages on a Debian-based system. When you install a package with apt, it is marked as automatically installed. This means that if you later decide to remove the package with apt, the package manager will also remove any other packages that were installed as dependencies of that package, even if they are no longer needed by any other installed packages.

The apt-mark command can be used to override this behavior and mark a package as manually installed. This can be useful if you have installed a package that is not available in the default repositories, or if you have removed a package that was installed as a dependency of another package but you want to keep it on the system. When a package is marked as manually installed, apt will not automatically remove it when you remove the package that depends on it.

If you encounter the below error while running the apt-mark command:

apt-mark: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
Debian apt-get install apt
Ubuntu apt-get install apt
Kali Linux apt-get install apt
Fedora dnf install apt
Raspbian apt-get install apt

apt-mark Command Examples

1. Mark a package as automatically installed:

# apt-mark auto {{package_name}}

2. Hold a package at its current version and prevent updates to it:

# apt-mark hold {{package_name}}

3. Allow a package to be updated again:

# apt-mark unhold {{package_name}}

4. Show manually installed packages:

# apt-mark showmanual

5. Show held packages that aren’t being updated:

# apt-mark showhold

6. To mark a package as manually installed:

# apt-mark markmanual package-name

7. To check if a particular package is marked as manually installed:

# apt-mark showmanual package-name

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to disable IPv6 on CentOS / RHEL 7
  2. How to activate and mount 2 Volume groups with same names in CentOS/RHEL
  3. How to Configure rsyslog to Filter/discard Specific IP Address in CentOS/RHEL 6,7
  4. systemctl Command Examples in Linux
  5. eject: command not found
  6. scsi_id Command Examples in Linux
  7. mkfs.fat Command Examples in Linux
  8. How to delete a non-root use with UID 0 in Linux
  9. mate-screenshot Command Examples in Linux
  10. esearch Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright