linuxmint / mintupdate

The Linux Mint Update Manager
320 stars 156 forks source link

mintupdate-cli erroneously updates blacklisted packages #723

Open Martin-Laclaustra opened 2 years ago

Martin-Laclaustra commented 2 years ago

Describe the bug mintupdate-cli erroneously updates blacklisted packages.

To Reproduce Steps to reproduce the behavior:

  1. Go to mintupdate GUI
  2. Blacklist a package (i.e. Thunderbird)
  3. Open the terminal
  4. Run:
    mintupdate-cli -r list
    # does not list blacklisted packages
    sudo mintupdate-cli -r upgrade
    # erroneously upgrades blacklisted packages!!

Expected behavior The same behavior as button "install updates" in the GUI. I.e. blacklisted packages are not upgraded.

Distribution:

Software version: 5.8.1 (freshly installed Mint 20.3, and only the mintupdate GUI upgrade applied)

Additional context Tested with Thunderbird just after fresh install.

Sahil-Poonia-zz commented 2 years ago

The bug exists in LMDE Beta 5 too.

I downgraded thunderbird using the following command:

sudo apt install thunderbird=1:78.14.0-1~deb11u1

the package is already blacklisted through GUI. still, mintupdate-cli upgraded thunderbird.

Possible reason:

mintupdate-cli ignores packages that are either specified with the flag -i or --ignore or the package is listed in the file /etc/mintupdate.blacklist. but the GUI doesn't add the package in this file when blacklisted. in my case, this file doesn't even exist.

Possible fix:

GUI should append/add the package to the file /etc/mintupdate.blacklist when blacklisted.

Sahil-Poonia-zz commented 2 years ago

to prevent thunderbird from upgrading through CLI, use following command:

sudo mintupdate-cli -r upgrade -i thunderbird
Martin-Laclaustra commented 2 years ago

to prevent thunderbird from upgrading through CLI, use following command:

sudo mintupdate-cli -r upgrade -i thunderbird

Does this blacklist it also for the GUI? If not... that is also needed for coherent functionality.

Sahil-Poonia-zz commented 2 years ago

to prevent thunderbird from upgrading through CLI, use following command:

sudo mintupdate-cli -r upgrade -i thunderbird

Does this blacklist it also for the GUI? If not... that is also needed for coherent functionality.

No, it's temporary argument only valid for that particular runtime. I mean, you'll need to specify -i thunderbird for every future execution. -i flag doesn't add the specified packages to any file.

Sahil-Poonia-zz commented 2 years ago

There is a button in the preferences of mintupdate GUI that says "Export blacklist to /etc/mintupdate.blacklist". but for some reason it doesn't quite do that. it will export the blacklist to /tmp/mintUpdate/blacklist instead of /etc/mintupdate.blacklist.

files in /tmp/ directory gets deleted at every reboot

Instead use apt-mark. it's a better option if you want to prevent some packages from upgrading.