Repository navigation
mintupdate-cli.py: Don't remove packages when running with --yes - #1114
Open
Amadeus-22 wants to merge 1 commit into
Open
Amadeus-22 wants to merge 1 commit into
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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