-Syu vs -Syuu vs -Syyu

Tried looking this up in google and on this forum but didn’t find any results.

What’s the difference between adding another ‘y’ or ‘u’ to the command? What does the ‘y’ and ‘u’ even stand for?

Thanks :smiley:

just do a “man pacman” from your Termnal, and all the switched/options are explained.
ie: “y” is explained under the “SYNC OPTIONS” section, …
and remeber, they’re case-sensitive.

1 Like

In case the man page is a bit much to sift through…

pacman -Syu updates your databases if the repositories haven’t been checked recently, and upgrades any new package versions.

pacman -Syyu forces updates of your databases for all repositories (even if it was just updated recently) and upgrades any new package versions.

pacman -Syuu upgrades packages and also downgrades packages (if you happen to have a newer version than in the repository). Normally this should not be used. Only if you’re trying to fix a specific issue due to a new package being removed from the repository.

5 Likes

Instead of man page, the builtin --help explains clearly and briefly:

$ pacman -S --help
usage: pacman {-S --sync} [options] [package(s)]
options:
-b, --dbpath set an alternate database location
-c, --clean remove old packages from cache directory (-cc for all)
-d, --nodeps skip dependency version checks (-dd to skip all checks)
-g, --groups view all members of a package group
(-gg to view all groups and members)
-i, --info view package information (-ii for extended information)
-l, --list view a list of packages in a repo
-p, --print print the targets instead of performing the operation
-q, --quiet show less information for query and search
-r, --root set an alternate installation root
-s, --search search remote repositories for matching strings
-u, --sysupgrade upgrade installed packages (-uu enables downgrades)
-v, --verbose be verbose
-w, --downloadonly download packages but do not install/upgrade anything
-y, --refresh download fresh package databases from the server
(-yy to force a refresh even if up to date)
–arch set an alternate architecture
–asdeps install packages as non-explicitly installed
–asexplicit install packages as explicitly installed
–assume-installed <package=version>
add a virtual package to satisfy dependencies
–cachedir set an alternate package cache location
–color colorize the output
–config set an alternate configuration file
–confirm always ask for confirmation
–dbonly only modify database entries, not package files
–debug display debug messages
–force force install, overwrite conflicting files
–gpgdir set an alternate home directory for GnuPG
–hookdir set an alternate hook location
–ignore ignore a package upgrade (can be used more than once)
–ignoregroup
ignore a group upgrade (can be used more than once)
–logfile set an alternate log file
–needed do not reinstall up to date packages
–noconfirm do not ask for any confirmation
–noprogressbar do not show a progress bar when downloading files
–noscriptlet do not execute the install scriptlet if one exists
–print-format
specify how the targets should be printed

1 Like

Add to the fine advice above, a really good cheat-sheet called the Pacman Rosetta

I have recently had the link tattooed to my forehead–in reverse. Should I ever forget the link, all I need do is look in any handy mirror…

rosetta

1 Like

I think the major confusion always comes with the presence of one or two y and what are their real effects. The man documentation, although correct of course, isn’t very helpful and it’s not always easy to find the answer online. So here is my attempt at explaining it:

This is what we know from reading documentation around:

  • -y checks the repositories hashes on the available mirrors, comparing them to the local system. If there is a difference, downloads and updates the package list from the available mirrors.
  • -yy doesn’t check anything. Just downloads and updates the package list for all repositories from the available mirrors.

On the surface, there doesn’t seem to be much point to this. Why not just, you know, always use -yy? And in fact, you can. It’s perfectly alright.

But it is pointless most of the time. The important word to retain from the above is ‘mirrors’. And this is an updated explanation:

  • -y checks the repositories hashes on the available mirrors, comparing them to the local system. If there is a difference, downloads and updates the package list from the available mirrors. Use it when you haven’t made any changes to your repository or mirror list.
  • -yy doesn’t check anything. Just downloads and updates the package list for all repositories from the available mirrors. Use it when you changed your repository or mirror lists.

So, if you ran pacman-mirrors, or added or deleted repositories, you want to follow that up with -Syyu once. Any subsequent updates can be done simply with -Syu.

In short, -Syu is the most common and useful of the two. Common, because you do tend to keep your mirrors unchanged for a good while. Useful, because it is faster, and only updates changed repositories and not all of them.

Any suggestions of corrections or additions to this post are very welcomed.

5 Likes

Thanks, putting the use cases like that helps clarify when to use each.

1 Like

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