xsuchy / fedora-upgrade

Upgrade Fedora to next version using DNF upgrade without the need to reboot during the upgrade.
GNU General Public License v2.0
43 stars 16 forks source link

Better way to remove retired packages #49

Closed Yetoo1 closed 1 year ago

Yetoo1 commented 1 year ago

Instead of just having the previous version passed into remove-retired-packages and compared the list of $UPGRADE_FROM with $UPGRADE_TO, why not just use dnf list --obsoletes and remove packages listed there. If the command does what I think it does which includes listing packages that are no longer in a repository I think this would allow removing retired packages not just from the previous version but from all versions if system was upgraded since many versions ago or remove-retired-packages wasn't run for some reason.

xsuchy commented 1 year ago

From DNF man page:

List packages installed on the system that are obsoleted by packages in any known repository.

I.e. it lists packages that are affected by Obsolete: * of some other package. But when a package is retired, no other package obsoleted it. And DNF will not list it.

Yetoo1 commented 1 year ago

@xsuchy Alternatively what if the list being compared is all installed packages (some variant of dnf repoquery -q --disableplugin=local --qf "%{name}" --installed) against $UPGRADE_TO/$NEW_LIST?