saltstack / saltstack/salt

[FEATURE REQUEST] ensure consistent behavior in pkg.list_updates between Debian-based and RedHat-based systems for held packages

Open
#68,138 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

There is a behavioral discrepancy in the pkg.list_updates function between Debian-based and RedHat-based systems:

  • On Debian-based systems, pkg.list_updates does not list packages that are held from being updated.
  • On RedHat-based systems, pkg.list_updates does list packages even when they are held
user@host:~$ salt-minion --version
salt-minion 3006.13 (Sulfur)
user@host:~$ apt-mark showhold
salt-common
salt-minion
user@host:~$ sudo salt-call pkg.list_upgrades
local:
    ----------
    sudo:
        1.9.13p3-1+deb12u2
user@host:~$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
[user@host ~]$ salt-minion --version
salt-minion 3006.13 (Sulfur)
[user@host ~]$ cat /etc/yum/pluginconf.d/versionlock.list 

# Added lock on Fri Jun 27 22:27:33 2025
salt-0:3006.13-0.*

# Added lock on Fri Jun 27 22:27:42 2025
salt-minion-0:3006.13-0.*

[user@host  ~]$ sudo salt-call pkg.list_upgrades
local:
    ----------
    salt:
        3007.5-0
    salt-minion:
        3007.5-0
[user@host ~]$ cat /etc/os-release .
NAME="Rocky Linux"
VERSION="9.6 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.6"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.6 (Blue Onyx)"

Describe the solution you'd like
I propose that held packages should not be included in the output of pkg.list_updates across all platforms for the sake of consistency and clarity. Held packages, by definition, are not eligible for upgrades and should be excluded unless explicitly requested.

Additional context
I believe check-update should be able to be used for both yum and dnf in this line of the code https://github.com/saltstack/salt/blob/master/salt/modules/yumpkg.py#L1040

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at pkg.list_updates and the referenced salt/modules/yumpkg.py line 1040, then compare the Debian-based implementation with the RedHat-based behavior shown in the examples. Check how yum and dnf handle check-update and held or version-locked packages. Done means held packages are consistently excluded from update listings across the supported platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.