LMDE 7 - Automatic kernel cleanup fails because installed kernel packages are marked as manually installed

Ouverte
#1,113 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
49/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
debian, python
Domaine
devops

Piste de recherche

Start by tracing the mintupdate-automation-autoremove service and the code that installs or marks kernel image and header packages during updates; the issue gives the apt-get autoremove --purge -y command and package marking checks as entry points. Reproduce on LMDE 7 by checking apt-mark showmanual and apt-mark showauto before and after a kernel update. Done means obsolete kernels become eligible for cleanup while the running kernel and a fallback remain installed.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

BUG
Bug description

Obsolete kernel versions are not removed by LMDE 7's automatic kernel cleanup, despite automatic removal being enabled in Update Manager.

After investigating the weekly cleanup service, I found that it executes:

/usr/bin/apt-get autoremove --purge -y

However, all version-specific kernel image and header packages are marked as manually installed. As a result, APT does not consider them eligible for automatic removal.

Steps to reproduce
  1. Install LMDE 7
  2. Enable Automatic Maintenance.
  3. Update LMDE 7 through Update Manager over a course of weeks/months.
  4. Allow multiple kernel updates to accumulate.
  5. Check installed kernel package markings using: apt-mark showmanual
  6. Observe that version-specific kernel image and header packages are marked as manually installed.
  7. Check automatically installed packages using: apt-mark showauto
  8. Observe that no version-specific kernel image or header packages are listed.
  9. Allow the scheduled mintupdate-automation-autoremove service to run.
Additional investigation

I previously encountered the same issue and manually marked older kernel packages as automatically installed using apt-mark auto.

This temporarily restored the expected cleanup behaviour:

  • August 8: I marked the older 6.12.100 and 6.12.96 kernel packages as automatic. The next autoremove successfully removed kernel 6.12.96.
  • August 26: After installing kernel 6.12.105, I found that newly installed kernel packages were marked as manual again. The next autoremove removed kernel 6.12.100 as expected.
  • November 2: Automatic cleanup has ran several times since August, but no kernels were removed while new ones were still being installed.

This suggests that subsequent kernel updates are causing previously corrected package markings to revert to manual.

Current system state
  • LMDE 7
  • Debian kernel series 6.12
  • Six installed kernel versions, from 6.12.101 through 6.12.115
  • All version-specific kernel image and header packages are marked as manually installed.
  • apt-mark showauto returns no version-specific kernel image or header packages.

The November 2. automatic cleanup log contains:

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Expected behaviour

Automatic kernel cleanup should remove obsolete kernel versions while retaining the currently running kernel and an appropriate fallback version.

Kernel updates should not cause obsolete kernel packages to become permanently ineligible for automatic removal.

Actual behaviour

Version-specific kernel packages are marked as manually installed, preventing APT's autoremove from removing them. The weekly Mint cleanup therefore runs successfully but removes no obsolete kernels.

The issue reappears after subsequent kernel updates, even after manually correcting the package markings.

Impact

Obsolete kernels accumulate over time and consume /boot space. On installations with a relatively small /boot partition, this eventually prevents further kernel updates due to insufficient free space. Like I have experienced several times now.

Langage dominant
Python
Étoiles
428
Forks
196
Merge moyen
16 h 9 min
PR mergées (30 j)
1

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de linuxmint/mintupdate

Toutes les issues de linuxmint/mintupdate

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.