Skip to content

Questions about pacman -Syyyyyyyyyyyy. After two y does the next y do anything?

I see all sorts of different things after looking at different forums and guides for arch. Some say -Syu some say -Syuu some say -Syyuu or -Syyu.

Here is what I know. -Sy refreshes, -Syy forces a refresh. Now heres where im lost some guide had -Syyyuu. Okay the -h says uu downgrades but what does yyy do?

so well I tried to see if it would create an error or something. Nope it ran just fine. So logically I kept adding 'y's and it still didnt crash. There doesnt seem to be a limit to the amount of u or y I can put on a command. Am i actually doing anything?

Does -Syyyyyyyyyyyyyyyyyyyyyuuuuuuuuuuuuuuuuuuuuuuuu do anything other than force 1 refresh then upgrade? Am i forcing a refreshing of my search N-2 times? I tried it and I only had the same download size with about the same download speed.

Does uuu download a version that doesnt exist?

188 points56 comments
Open on Reddit
About this post
Posted
Archived
Score
188 · 93% up
Kind
Text
ID
lfcocs

Author

44
posts
30
comments
13
media
View profile

69 comments

They don't do anything.

Syu is the one that should be used 99% of the time, syyu is to force a refresh of the mirrors and you might use it if you changed the mirrorlist but it still shouldn't be needed, the double uu is actually for something different, is to downgrade a package if needed:

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.  

I've seen the triple y in a few guides but the third y doesn't do anything.

110 points

Syu is the one that should be used 99%

^This.

Syyu is for douchebags who are needlessly using bandwidth of their mirrors, i.e. the people paying for the server that provides that user with a free service.

98 points

I'm going to duck in advance...

I think this is overblown. Sure -Syy is usually not needed, but it's a very small inefficiency. The transfer is small, but even more, the repos are constantly updating (and the bigger repos are updating more frequently than the smaller ones), so very often -Sy is going to be a full download anyway. If mirror sync bandwidth was a huge deal, we'd need to gate how frequently batches of new packages are exposed.

So without knowing how frequently someone might change their mirrors (e.g., using the reflector), recommending -Syy isn't so bad because then you don't need to have a separate conversation about the edge cases.

45 points
unknown author2 hidden

Deleted before we saved it.

4 points

Yeah it just checks if there's a double one then it doesn't do anything else.

-y, --refresh
Download fresh package databases from the server. Use twice to force a refresh even if databases are up to date.  

I actually think the triple y comes from the misunderstanding of someone that thought it was a y for each repository(core,community and extra).

17 points

It's a pretty unixy old convention for other commands, accepting a series of repeated flags for some increasing effect. Probably familiar to most would be -v flags for some common commands, the single -v equating to --verbose, each repetition of the flag enabling increasing levels of output verbosity, or incrementing the level of error reporting. pacman's many options can be daunting, and several other option flags can be repeated in this same way, for some additive effect that accrues with each repetition. I always appreciate this style as an intuitive mnemonic device, as it seems to help me remember and categorize some of the more complex operations.

2 points

Nice explanation.

Kept things to the point and simple.
Love it.

2 points

https://git.archlinux.org/pacman.git/tree/src/pacman/pacman.c#n830

	case 'y':
		(config->op_s_sync)++;
		break;

Every time you specify y, it increments by one.

https://git.archlinux.org/pacman.git/tree/src/pacman/util.c#n151

int sync_syncdbs(int level, alpm_list_t *syncs)
{
    int ret;
    int force = (level < 2 ? 0 : 1);

It checks to see if the level is two or higher, and if so, forces the refresh. Anything above 2 is treated the same.

80 points

Specifying -y 65537 times will be treated the same as once:

pacman -S$(python -c 'print("y"*(2**16+1))')
83 points

That ternary frustrates me. Why not just int force = level >= 2;

3 points

It means that you should stay away from that guide because chances are the author doesn't know what they are talking about.

43 points
unknown author12 hidden

Deleted before we saved it.

12 points

It does work in the sense that it probably will upgrade packages. The second y causes a forceful refresh of the package list, the third y does nothing and the second u allows downgrades.

4 points
unknown author2 hidden

pacman -Syyyyyyyyyyyy will reinstall grub

22 points

That's for sd-boot. Grub is pacman -Syyyyyyyyyyy

8 points
unknown author

ahh.. sorry ! you're right !! :D

4 points

pacman -Syyy redownloads the mirror list and merges it with the one from a nearby parallel universe, more y means it merges packages from further timelines. This isn't recommended, though, because the more differentiated the universes get, the likelier that a package will use an architecture that was never created in this universe, like Gx128 or ARM4, or rely on standards that were created differently.

More u means it downloads packages from (further into) the future, though this isn't recommended as some packages depend on other packages that don't exist yet. Dependency handling on future packages is not yet implemented, but it is planned for an upcoming build.

(anything more than -yyuu is ignored, if you want a real answer)

12 points
unknown author4 hidden

You're basically forcing servers to refresh your pacman cache for no reason.

9 points

that advice is for people who set up cron jobs to update every 15 minutes, not someone playing around trying to understand pacman. exploration is how you learn and a server does not care that someone tried to update four times in a row instead of one if this is an abnormal thing

10 points
unknown author

While I understand what you mean, the exploration didn't need hundreds of y's in my opinion. Also it's definitely not uncommon for flags to be ignored after n times, the same happens here.

I've only ever needed to use -Syyu once, right after an install, where some packages were more up to date on my machine than on the new mirror I was using, so switching mirrors required this for a fast fix. Otherwise it's almost always unnecessary.

1 points
unknown author1 hidden

Deleted before we saved it.

5 points
unknown author

More than 2 y are just ignored I guess, as it doesn't make sense to make multiple refreshes in the same go. You really shouldn't do it as it adds strain to the servers for no reason.

2 points

I guess someone should write a blog post titled “Arch Beginner Guides suggesting pacman -Syy considered harmful”. No offense to OP, but this bad habit just keeps coming up even though official Arch resources are quite clear on the matter...

4 points

Did your terminal fall off a cliff? I kind of read that as the Goofy Scream for some reason ;)

2 points
unknown author

Deleted before we saved it.

2 points

Speaking of refreshing. Is there a public syncthing-compatibile (or syncthing-like) means of syncing your db and maybe even fetching packages?

1 points

You can run in a .timer, but, depending on the granularity of your timer you're most likely going to do -Sy anyway when you upgrade. So overall you may be generating more load on mirrors than necessary. If you have a private internal mirror for a bunch of systems it makes more sense.

That said, I use the kernel.org mirror and have never really agreed with the sentiment here that -Syy is particularly rude, must be a rounding error compared to the rest of the load on the mirrors.

1 points

It makes you look cool in front of Ubuntu people. That's the power of pacman

1 points
unknown author1 hidden

so "syyu"ing once a day is fine right?

-1 points

Not sure my sarcasm detectors are working, but do you trust you hard drive to not randomly flip bits or magically mess with your package database? Then you won't need -Syyu :P

And in that case you have bigger issues anyway.

I guess you can use yy if you suspect something went wrong with the previous package db refresh.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.