Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add update option with dnf5 distro-sync #242

Closed
AngryPenguinPL opened this issue Dec 29, 2024 · 6 comments
Closed

Add update option with dnf5 distro-sync #242

AngryPenguinPL opened this issue Dec 29, 2024 · 6 comments

Comments

@AngryPenguinPL
Copy link

I would like to ask if it is possible to add an option to update system using dnf5 distro-sync?

I know that the "dnf update" command is enough to update most of dnf systems, but in some situations when you want to synchronize packages with versions from the repository, this option is necessary because it not only performs the update but also takes into account downgrade, replace, etc.

This option would be especially useful in OpenMandriva, where dnf distro-sync is used for updates - mainly due to remnants from the Mandriva times, where urpmi repositories contained epochs or libname with numbers - now we are systematically getting rid of them and we are forced to update the system using dnf distro-sync - which excludes the use of GUI applications for updates. In OpenMandriva we have been providing dnfdragora installed by default for many years and it would be nice if we could also use it to perform a complete system update using distro-sync.

Are there any chances for this?

@anaselli
Copy link
Collaborator

Well according to org.rpm.dnf.v0.rpm.Rpm.xml

<method name="distro_sync">
    <arg name="pkg_specs" type="as" direction="in" />
    <arg name="options" type="a{sv}" direction="in" />
</method>

it would be possible yes. I have to understand how to present this command and since i don't know that much on it, also study the behaviour.

Do you think there is anybody from open mandriva that could help in adding this?

@anaselli
Copy link
Collaborator

@AngryPenguinPL are you able to test my changes from git?

@AngryPenguinPL
Copy link
Author

AngryPenguinPL commented Jan 2, 2025

Thanks @anaselli for adding distro-sync.

Right now it looks like the distro-sync option itself works but:

  1. dnfdragora does not check for available packages in the repository. So, if it is to find any packages, I have to manually execute the command in the console: "sudo dnf5 clean all && dnf5 distro-sync" and then cancel the operation. Only then dnfdragora will find the packages in the distro-sync section.

This looks like a problem with the migration to dnf5, and not a distro-sync itself.

  1. Clicking on distro-sync will list only the regular packages for update and skip reinstall and downgrade.

I think this option should be combined with downgrade or reinstall. Because that is the idea of ​​distro-sync - that it will perform all operations. My idea is to combine these options reinstall, downgrade and distro-sync into one.

Let's say I compiled the libfoo1.2.0 package manually (for test or whatever) and installed it. In the repository I still have libfoo1.1.0. After running distro-sync this package will be downgraded to the version currently in the repositories.

  1. During the distro-sync operation in dnfdragora an error will appear.
    It is worth adding that the operation itself will be successful despite the error.
    Zrzut ekranu z 2025-01-02 17-53-53

@anaselli
Copy link
Collaborator

anaselli commented Jan 2, 2025

regaring 3, i opened an issue Conan Kudo rpm-software-management/dnf5#1978 it seems we get that often in many transactions.

@anaselli
Copy link
Collaborator

anaselli commented Jan 2, 2025

  1. dnfdragora does not check for available packages in the repository. So, if it is to find any packages, I have to manually execute the command in the console: "sudo dnf5 clean all && dnf5 distro-sync" and then cancel the operation. Only then dnfdragora will find the packages in the distro-sync section.

It isn't like that. i just decided to show only installed and updates, but if you think it should be checked what is not installed as well, explaining me why so that i can understand and i add it eventually

if you manage distro sync without any selection it should try to sync all, in mageia for instance downgrades some tainted packages and installs all the updates.

@anaselli
Copy link
Collaborator

anaselli commented Jan 2, 2025

I think this option should be combined with downgrade or reinstall. Because that is the idea of ​​distro-sync - that it will perform all operations. My idea is to combine these options reinstall, downgrade and distro-sync into one.

from dnf5 manual:
The distro-sync command in DNF5 serves to synchronize the installed packages with their latest available version from any enabled repository. It upgrades, downgrades or keeps packages as needed.

So it should take care of it without combining anything and since it says "installed" it should be correct to show them only @Conan-Kudo wdyt?.
Though i had problems in synchronizing mageia cauldron and fedora rawhide. I probably need to manage options as well and not let them as default... but that part is not well documented on dnfdaemon apis... I need more investigations on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants