Pacman equivalent to pamac upgrade --force-refresh

I got the error: failed to synchronize all databases (unable to lock database) and I can fix it with sudo pamac upgrade --force-refresh, I think.

But what is the same comment with pacman? Is it -Syuu?

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)

man pacman
1 Like

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. :slight_smile:

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?

I can’t say - I have rarely had the problem - but if your action accidentally collides with pamac fetching database - then it could happen.

As for pamac - I guess - you never know :slight_smile:

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.

https://wiki.archlinux.org/title/Pacman#"Failed_to_init_transaction_(unable_to_lock_database)"_error

1 Like

I get you are a bit scared after me biting the hand that feeds at times.

I want you to know I value your input VERY HIGH!
Thank you!

Edit
After disabling auto updates in pamac gui, the normal update (sudo pacman -Syu) went through normally.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.