If the use of "--allow-change-held-packages" seams dangerous to you (it might not as we also set "-s" in the command line, it should be safer to juste replace "-y" by "--trivial-only" which will answer yes for all non dangerous questions and no on the orthers.
> --trivial-only > Only perform operations that are 'trivial'. Logically this can be considered related to --assume-yes; where --assume-yes will answer yes to any prompt, --trivial-only will answer no. Configuration Item: APT::Get::Trivial-Only. What about replacing the whole complicated line by something more simple based on apt like this: apt list --upgradable 2>/dev/null | sed -ne 's#^\(.*\)/.*$#\1#p' -- Landry MINOZA [email protected]

