Repository navigation
mintupdate-cli.py: Don't remove packages when running with --yes - #1114
Amadeus-22 wants to merge 1 commit into
Conversation
With --assume-yes apt-get accepts its own solution to a Breaks or Conflicts, including removing installed packages. Automatic upgrades run "mintupdate-cli upgrade --yes", so a package published before the packages it breaks were updated made the automatic upgrade remove them without anybody seeing it (linuxmint#1111). Pass --no-remove along with --assume-yes. apt-get then aborts with "Packages need to be removed but remove is disabled" and installs nothing, and the next run picks the updates up once the repository is consistent. Without --yes nothing changes: apt-get shows the removals and asks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I reported #1111, and this covers what happened there. With One gap though. |
|
Thanks @martin152 for testing it on 22.3 and confirming the apt side. The gap you describe is #1107, and #1115 addresses it: |
Fixes #1111
Problem
mintupdate-cli upgrade --yes, which the automatic upgrades run, passes--assume-yestoapt-get install. When an update Breaks or Conflicts with installed packages, apt-get resolves it by removing them and--assume-yesaccepts that, so a repository caught between two uploads (Proton VPN in #1111) makes the automatic upgrade uninstall the app without anyone seeing it.Fix
Pass
--no-removetogether with--assume-yes. apt-get then stops withE: Packages need to be removed but remove is disabled.(exit 100) and installs nothing; the next run installs the updates once the repository is consistent again. Interactive use (without--yes) is unchanged: apt-get lists the removals and asks. The--yeshelp text and man page say so.A side effect: while such a conflict exists, the automatic upgrade installs nothing at all, not only the conflicting update. I think that is the safer default for an unattended run, but I can change it to hold back only the conflicting update if you prefer.
How tested
tests/test_cli_upgrade.pychecks the apt-get arguments with and without--yes(/usr/bin/python3 -m unittest discover -s tests, 14 tests OK; the new test fails on master).chronyConflicts with the installedsystemd-timesyncd:apt-get install --simulate --assume-yes chronyremovessystemd-timesyncdapt-get install --simulate --assume-yes --no-remove chronyprintsE: Packages need to be removed but remove is disabled.and exits 100🤖 Generated with Claude Code