manjaro / pamac

Graphical Package Manager for Manjaro Linux with Alpm, AUR, Appstream, Flatpak and Snap support
GNU General Public License v3.0
235 stars 42 forks source link

Fix/systemd pamac-mirrorlist timer and service #393

Closed kewlfft closed 6 years ago

kewlfft commented 6 years ago
It cannot be stressed enough, that every run of pacman-mirrors requires you to syncronize your database
$ sudo pacman -Syy
If you fail to do so, the issue/s which had you make change might not be solved. Furthermore you might run into partial-updated scenario which can cause havoc in your system.
philmmanjaro commented 6 years ago

@guinux: I don't think we need pacman here to sync the DBs. Pamac has a similar feature. Can you double-check this?

kewlfft commented 6 years ago

Thanks very much for the feedback, let me know if I misinterpreted and I will correct, randomization of the timer is also an improvement I propose

guinux commented 6 years ago

No pamac never auto force dba sync. So I will merge this. Thanks @kewlfft

AladW commented 6 years ago

...unattended partial upgrades in a new iteration? Marvelous.

kewlfft commented 6 years ago

@AladW this is changing server and then forcing a refresh of all package databases on the new server, anything wrong with it?

AladW commented 6 years ago

I don't get what you mean by "on the new server", since the service (and with that pacman -Sy) is run on the client, right? Again, not much of an issue on Manjaro but problematic on Arch.

kewlfft commented 6 years ago

Sorry by changing server I meant changing to the closest Manjaro mirror. After changing mirror we force a refresh of the package database (on this closest mirror). The pacman -Syy is indeed run on the client. Is it clearer? @AladW if you have any suggestion for improvement I would be happy to implement it - thanks

AladW commented 6 years ago

You're not in the danger of a partial upgrade because your mirrors were upgraded. Any potential changes in the mirror databases are only propagated to pacman (read: copied to /var/lib/pacman/sync) after you've run -Syy. But since your local system is now inconsistent with the new databases, you've effectively done a partial upgrade.

https://bbs.archlinux.org/viewtopic.php?pid=1771159#p1771159

In other words the post command is simply not required here. Any old databases you've downloaded remain on disk.

kewlfft commented 6 years ago

@AladW Thanks for pointing this out, the Manjaro wiki on the topic is therefore rather confusing. It is better to keep the old databases consistent with the system even after changing mirror then, and only use -Syu. If I understand correctly now, this step is a bit embarrassing and should be removed.

kewlfft commented 6 years ago

@AladW looking into it what you say make total sense and I can't explain the Manjaro wiki warning, @philmmanjaro @guinux before reverting this change, if you agree with Alad, what needs to be done first is correct the wiki otherwise someone else could, like me, want to implement again what is presented as an "important" note in the wiki. What is your view? Thanks all.

philmmanjaro commented 6 years ago

@kewlfft: In Manjaro it is recommended if you switch branches to do a -Syy first. Arch doesn't need that, as it doesn't use branches at all. Since this is focused software for Manjaro a revert is therefore not needed. Arch might do a revert on their packages. For Manjaro itself I don't see any steps to be taken.

kewlfft commented 6 years ago

@philmmanjaro We had some discussion on the forum and the recommended action is now -Syyu after using pacman-mirrors in order to avoid partial upgrades. The Manjaro wiki has been amended accordingly: forum - pacman-mirrors forum - wiki

I do understand -Syy is recommended after switching branch but still, without doing a full upgrade right away, the system state being inconsistent with the database isn't it a potential source of issue if this is followed by a package install or an individual upgrade? You obviously know this better than me and we may miss something that makes the full upgrade not necessary after the database local propagation, if you can let us know in this case.

philmmanjaro commented 6 years ago

Here we only want to sync with DBs, however don't upgrade the system. That is why we only use -Syy here.

kewlfft commented 6 years ago

@philmmanjaro: After this -Syy, if the user installs a package that has new libraries, and he does that before doing a full upgrade, do you confirm it won't break things? That was my concern. (And obviously we won't launch a full upgrade here)

AladW commented 6 years ago

It's still completely unclear as to why an -Sy would be "recommended" when switching branches, apart from avoiding 404s. Anyway, I have no knowledge or interest in Manjaro's infrastructure so propose the following easy workaround:

Put in the header that this tool should not be used with Arch under any circumstance, or at least, that doing so is unsupported both on the Arch end of things and Manjaro end of things.

jonathonf commented 6 years ago

This behaviour was discussed as introducing partial upgrades on the forum with the result that the previous advice of pacman -Syy being replaced with pacman -Syyu.

Unless I've missed something, this change should be reverted.

guinux commented 6 years ago

Ok I removed pacman -Syy after updating mirrorlist (21b8e96).