[Bug 2100937] Re: apt install --mark-auto does not retain auto mark

Jarno Suni 2100937 at bugs.launchpad.net
Mon May 19 14:11:32 UTC 2025


In the manual page it also says that "This is equally to running apt-
mark auto for all installed packages." It is unclear from the wording if
it means all freshly installed packages (meaning here the packages no
version of which were installed before) or also packages that were
upgraded/downgraded or even all packages that were ordered for
installation in the command line and their dependencies.

Even if the auto-state is unchanged with --mark-auto when upgrading, it
might not be unchanged without --mark-auto, if the package is upgraded
and the package does not have a reserve dependency installed. (The
output does not show the difference, though, at least for apt 2.7.14) So
the usual rule is not that simple. I wonder in which case user would
want to have such a package marked as auto, though.

I have a script by which I want to downgrade packages matching current
software source settings, and I want to protect a package from being
marked manual without a reason when possibly downgrading the package and
possibly retaining the version of it. Currently I do the protection so
that I inspect the output for lines like "<pkg name> set to manually
installed." of the apt install command and run apt-mark auto for those
packages thereafter.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/2100937

Title:
  apt install --mark-auto does not retain auto mark

Status in apt package in Ubuntu:
  New

Bug description:
  e.g.

  1) sudo apt install ppa-purge
  2) sudo apt-mark auto ppa-purge
  3) sudo apt install --mark-auto ppa-purge

  Expected result:
  ppa-purge is marked as auto
  What happend:
  ppa-purge is marked as manual

  If line (2) is omitted, I think the result should be manual, even if
  it is unintuitive. At least I need a way to retain the auto/manual
  status when I install a package (without --reinstall) a version of
  which is already installed no matter which auto/manual status the
  previously installed package has. i.e. I want an option to retain the
  auto/manual status of the old package when I use "apt install
  pkg/target_release", because I want auto-removing work as expected
  thereafter. It is debatable what should the status be, if there was no
  package installed before.

  BTW ppa-purge relies on "apt install" marking packages with the right
  auto status, but it doesn't seem to work now. We need clear
  documentation about when auto status is changed.

  See also https://unix.stackexchange.com/q/786177/111181

  ProblemType: Bug
  DistroRelease: Ubuntu 24.04
  Package: apt 2.7.14build2
  ProcVersionSignature: Ubuntu 6.8.0-54.56-generic 6.8.12
  Uname: Linux 6.8.0-54-generic x86_64
  ApportVersion: 2.28.1-0ubuntu3.3
  Architecture: amd64
  CasperMD5CheckResult: unknown
  CurrentDesktop: XFCE
  Date: Wed Mar  5 13:03:48 2025
  InstallationDate: Installed on 2019-12-05 (1917 days ago)
  InstallationMedia: Xubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
  SourcePackage: apt
  UpgradeStatus: Upgraded to noble on 2025-01-12 (52 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/2100937/+subscriptions




More information about the foundations-bugs mailing list