[Bug 1817350] Re: Running 'aptitude update' clears hold flags on packages

Carlos Miguel Bustillo Rdguez charlesm1888 at gmail.com
Thu Jan 16 16:24:05 UTC 2020


I can confirm the problem is present in Debian GNU/Linux 9.11 (stretch)
and Ubuntu 18.04.3 LTS. I noted the issue after run by the second time
an Ansible playbook with the apt module. As a workaround, I set
`force_apt_get: yes` in the apt module.

It's very odd this behavior because in my case the file
`/var/lib/aptitude/pkgstates` already existed. The first time I ran
`aptitude update`, the command cleared all hold flag in packages that
had set before; also 'hold' was removed from the status field here
`/var/lib/dpkg/status`. Then I marked again the packages with the hold
flag and I run `aptitude update`, `aptitude safe-upgrade`, `apt-get
update`, `apt-get upgrade`, `apt update` and `apt upgrade` without
issues.

Any hints are welcome!

Thanks in advance!!

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

Title:
  Running 'aptitude update' clears hold flags on packages

Status in aptitude package in Ubuntu:
  Confirmed

Bug description:
  When running an 'aptitude update' for the very first time, it seems to
  clear up any hold flags that were previous put in place via 'apt-mark
  hold <package>'.

  1:
  root at cb-qa-lb-1:~# lsb_release -rd
  Description:    Ubuntu 18.04.2 LTS
  Release:        18.04

  2:
  root at cb-qa-lb-1:~# apt-cache policy aptitude
  aptitude:
    Installed: 0.8.10-6ubuntu1
    Candidate: 0.8.10-6ubuntu1
    Version table:
   *** 0.8.10-6ubuntu1 500
          500 http://ca.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
          100 /var/lib/dpkg/status

  3:
  When a 'hold' flag is set on a package, it should be kept.  Doing an 'aptitude update' should not be clearing these package flags.  This is not the case as the hold flag is getting removed.

  4:
  All 'hold' flags on packages that were previously set get cleared.

  Upon running 'aptitude update', it seems to create
  /var/lib/aptitude/pkgstates, and also update /var/lib/dpkg/status,
  which seems to remove any flags on packages that were present.

  Pastebin here with some output:
  https://paste.ubuntu.com/p/VF6kQRbSmf/

  This only seems to happen when running 'aptitude update' on an initial
  run.  Doing an 'apt update' does not cause any issue.

  Note that running subsequent 'aptitude update' with
  /var/lib/aptitude/pkgstates already existing does not seem to cause
  any issue anymore and any hold flags that get set are kept.

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



More information about the foundations-bugs mailing list