This is only an issue if the database is locked with /var/lib/pacman/db.lck - usually the case if two instances is using libalpm at the same time.
The equivalent to the pamac command would be
sudo pacman -Syyu
The doubled yy is force db download - the doubled uu is downgrade (only effective if a package exist in the system which has a higher version than the one in the repo)
Ah, I thought that would force a download from the mirrors but would just throw an error complaining the database is locked. I thought the uu was the force update of the database.
There are soooo many options in pacaman, I simply have to keep studying the man page.
I just realized I had forgotten to turn off automatic updates in pamac gui, do you think that might be the reason the error occurred?
At the risk of ‘highlighting and answering’ being a problem again…
2 u’s allows for downgrade during sync. That is all.
All other flags work as expected (and -Syyu is the answer the the title question).
If you use -Syuu 99% of the time it will be the same as -Syu … excepting those cases where the repo is offering a package with a lower version than the one installed on your system.
$ man pacman
[...]
-u, --sysupgrade
Upgrades all packages that are out-of-date. Each currently-installed package will be examined and upgraded if a newer package exists. A report of all packages to
upgrade will be presented, and the operation will not proceed without user confirmation. Dependencies are automatically resolved at this level and will be
installed/upgraded if necessary.
Pass this option twice to enable package downgrades; in this case, pacman will select sync packages whose versions do not match with the local versions. This can be
useful when the user switches from a testing repository to a stable one.
Additional targets can also be specified manually, so that -Su foo will do a system upgrade and install/upgrade the "foo" package in the same operation.
[...]
Yes its possible - that error usually comes from having multiple package managers running at once and/or not exiting them gracefully.