You are not logged in.

#1 2021-02-12 13:23:39

computronium
Member
Registered: 2020-08-19
Posts: 5

[Solved] pacman -Syyu... I understand the what not the why.

I have read the fine manual. And after skimming through this forum I am not uncertain that this hasn't been asked/answered.

Passing two --refresh or -y flags will force a refresh of all package databases, even if they appear to be up-to-date

But why would one want to do that? In what scenarios will it be useful?

TIA!

Last edited by computronium (2021-02-13 07:39:48)

Offline

#2 2021-02-12 13:26:55

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,645

Re: [Solved] pacman -Syyu... I understand the what not the why.

Almost never, which is why you don't see people that actually understand how Arch works recommend it.

There are a few special cases, like corrupting your database due to trying to update while being redirected by a internet portal page, or if you want to run a downgrade of your system state for some reason. But these are special and abnormal circumstances, assuming your own clock and the mirror you are connecting to are in a sane state and you intend to do a normal system update, there's never a reason for -yy

Last edited by V1del (2021-02-12 13:27:35)

Offline

#3 2021-02-13 06:31:04

computronium
Member
Registered: 2020-08-19
Posts: 5

Re: [Solved] pacman -Syyu... I understand the what not the why.

@V1del Thank you for your letting me know of when the extra -y might be needed, which is next to never. However, your answer also alludes to its use not being advisable in most cases. Could you please elaborate on what could go wrong with its inadvertent use? I think that will make this answer much more complete.

Offline

#4 2021-02-13 07:18:59

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [Solved] pacman -Syyu... I understand the what not the why.

For you, nothing bad happens if you use "-yy" by mistake. It will download all databases even if you already have the newest version of some of them, but this shouldn't break anything.

It could be annoying for the mirror servers if everyone would use "-yy" all the time because of the extra data usage.

Offline

#5 2021-02-13 17:42:14

Blique
Member
Registered: 2021-02-03
Posts: 4

Re: [Solved] pacman -Syyu... I understand the what not the why.

Newbie user here, but I can give an edge case (that I think would be unlikely or frowned upon to occur in the first place):

If you create your own package repo and call it something like "core" (or "extra", or ....) and sync to it, I think you'll need to use -yy if you want to later re-sync to the original "core"(/....) repo. (Feel free to correct if I'm wrong.)

Last edited by Blique (2021-02-13 17:42:54)

Offline

#6 2021-02-13 17:43:37

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,541

Re: [Solved] pacman -Syyu... I understand the what not the why.

yeah, there's plenty of really dumb things you can do that might need it, we don't need to go through all of them.

Offline

#7 2021-02-15 01:03:22

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] pacman -Syyu... I understand the what not the why.

computronium wrote:

@V1del Thank you for your letting me know of when the extra -y might be needed, which is next to never. However, your answer also alludes to its use not being advisable in most cases. Could you please elaborate on what could go wrong with its inadvertent use? I think that will make this answer much more complete.

If you have

  • multiple mirrors in your mirrorlist

  • the first one dies one day

  • the second one is out of date, and older than the first one before it died

then -Syyu will force downgrade to an old mirror. You'll likely get some log messages that you have local packages newer than anything available in the repos. But -Syyu will report no updates and cleanly exit.

Then you try to pacman -S some-new-package. You don't think you did anything wrong, because you never used -y without -u and never canceled a full system upgrade. But nevertheless, you ended up in a partial upgrade... because you downgraded the mirrors, then installed old packages from the downgraded mirrors.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#8 2021-02-15 02:20:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,520
Website

Re: [Solved] pacman -Syyu... I understand the what not the why.

If were going to list edge cases, why start with those that are extremely silly and as noted "frowned upon" and instead list all the really cool ones.  I can think of plenty if we assume you have access to a classic DeLorean and a flux capacitor.  But for the rest of us, that's not so relevant.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2021-02-15 15:53:17

Blique
Member
Registered: 2021-02-03
Posts: 4

Re: [Solved] pacman -Syyu... I understand the what not the why.

Scimmia wrote:

really dumb

Trilby wrote:

extremely silly

As a new user, with my first post, I was hoping to provide an answer to the original poster's question "But why would one want to do that? In what scenarios will it be useful?" As well as check my own understanding of how pacman and Arch Linux package repos work.

In fact, I have used this approach to create my own automated install of Arch Linux. I recently figured out how to download packages and install them (eg. on another system) offline, with my simple approach including: downloading packages (giving pacman an empty cachedir and empty dbpath--in the commandline arguments) and creating a repo with the "repo-add" command. I chose to use the name "core" for the repo simply because it was already first in the default pacman.conf file. My script then commented out the "extra" and "community" repos, and used a local (file://) Server in the mirrorlist. The rest of the script performed the installs from the local repo, and then at the end, I reconfigure the pacman.conf and mirrorlist to (roughly) the defaults, if the system is to later go online, and issue a pacman -Syyu to re-sync to the official core.

I presumed this would be fine to do, but perhaps I am wrong.

Offline

#10 2021-02-15 16:07:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,520
Website

Re: [Solved] pacman -Syyu... I understand the what not the why.

Blique wrote:

I chose to use the name "core" for the repo simply because it was already first in the default pacman.conf file.

You could have chosen any name at all, and you intentionally chose one that would conflict with the official repos because ... it was already there?  You're editing the file anyways, chose a name for the repo that doesn't conflict.  You go out of your way to create a problem when there are literally infinitely many ways to avoid the problem and only three ways to create the problem - I'd say that meets the criteria of silly, to say the least.

As for the rest of that, I'm not sure if there's any reason for your own repo in the first place.  If you are really just downloading official packages, don't create a repo, don't mess with pacman.conf, and just put all the package files into the cachedir and be done with it.  (edit: I suppose you'd need the database files to go with them).

I'm sorry if the replies made you feel unwelcome here.  You're most welcome.  But if bad ideas are presented, they will be labeled as such so that others aren't misled by them.  You noted yourself that it'd be likely frowned upon - so are you really surprised to have been right?  EDIT: in fact, this just seems rather disengenous:

Blique wrote:

I can give an edge case (that I think would be unlikely or frowned upon...

I presumed this would be fine to do

Last edited by Trilby (2021-02-15 16:12:00)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2021-02-15 16:21:47

Blique
Member
Registered: 2021-02-03
Posts: 4

Re: [Solved] pacman -Syyu... I understand the what not the why.

I presumed my approach would be fine to do--for me. It's not necessarily something that I, as a new user, would recommend to other (particularly new) users. But, also as a new user, I was not sure if my apprehension was warranted, which is why I stated "I think" it would be unlikely or frowned upon. I wasn't sure if it would be. Now I know.

As you stated in your edit, I think one would need the database files (which implies a repo? I'm not sure if they're equivalent), which is why I use the repo-add command and say I created a repo.

Last edited by Blique (2021-02-15 16:25:44)

Offline

#12 2021-02-15 20:47:34

micronetic
Member
Registered: 2020-02-26
Posts: 40

Re: [Solved] pacman -Syyu... I understand the what not the why.

I have watched a Youtuber doing -Syyu after a fresh Arch installation, after he installed everything and rebooted he did it every time. So how I understand it is not needed? Just a regular -Syu after a fresh Arch installation is enough?

Offline

#13 2021-02-16 00:43:26

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 696

Re: [Solved] pacman -Syyu... I understand the what not the why.

micronetic wrote:

I have watched a Youtuber doing -Syyu after a fresh Arch installation, after he installed everything and rebooted he did it every time. So how I understand it is not needed? Just a regular -Syu after a fresh Arch installation is enough?

I watch youtube for entertainment or wasting time, it works for learning to do stuff with your hands visually, or at least for me since I am more skilled at visual copycat anyways.

But for Arch and similar stuff? Nope, just don’t.
The wiki and man pages/tomes are your friend, and that’s it.

It’s been a while since I had to do a -Syyuu and that was when one of the mirrors I used got stale. So, big changes in mirrorlist = -Syyuu, databases broken = -Syyu, everything else, idk, haven’t suffered those yet.

After an arch install from archiso the system is usually up to date, and most of the time I either update weekly or when installing something and it’s missing from the repos because an update.

And of course, check news and issues, nobody wants to update to an hazardous environment in their daily driver after all, unless you like breaking things and have archiso for the rescue.


My reposSome snippets

Heisenberg might have been here.

Offline

#14 2021-02-16 01:24:05

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] pacman -Syyu... I understand the what not the why.

Blique wrote:

I presumed my approach would be fine to do--for me. It's not necessarily something that I, as a new user, would recommend to other (particularly new) users. But, also as a new user, I was not sure if my apprehension was warranted, which is why I stated "I think" it would be unlikely or frowned upon. I wasn't sure if it would be. Now I know.

As you stated in your edit, I think one would need the database files (which implies a repo? I'm not sure if they're equivalent), which is why I use the repo-add command and say I created a repo.

- Download all the .pkg.tar.zst files you need into a directory
- copy over the repo *.db files you used from /var/lib/pacman/sync/ into that directory
Add to the top of /etc/pacman.d/mirrorlist, "Server = file:///path/to/that-directory"

pacman will now try to download [repo-name].db from the configured mirror over file:///, and load packages from there too. If it cannot find the package, it will 404, and then go to the next mirror to try to find it. Hopefully you cached all the packages you'll need.

No need to regenerate the databases by hand.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#15 2021-02-16 03:45:09

Blique
Member
Registered: 2021-02-03
Posts: 4

Re: [Solved] pacman -Syyu... I understand the what not the why.

eschwartz wrote:

- Download all the .pkg.tar.zst files you need into a directory
- copy over the repo *.db files you used from /var/lib/pacman/sync/ into that directory
Add to the top of /etc/pacman.d/mirrorlist, "Server = file:///path/to/that-directory"

pacman will now try to download [repo-name].db from the configured mirror over file:///, and load packages from there too. If it cannot find the package, it will 404, and then go to the next mirror to try to find it. Hopefully you cached all the packages you'll need.

No need to regenerate the databases by hand.

Thank you very much.

Offline

#16 2021-02-17 12:48:13

micronetic
Member
Registered: 2020-02-26
Posts: 40

Re: [Solved] pacman -Syyu... I understand the what not the why.

GaKu999 wrote:
micronetic wrote:

I have watched a Youtuber doing -Syyu after a fresh Arch installation, after he installed everything and rebooted he did it every time. So how I understand it is not needed? Just a regular -Syu after a fresh Arch installation is enough?

I watch youtube for entertainment or wasting time, it works for learning to do stuff with your hands visually, or at least for me since I am more skilled at visual copycat anyways.

But for Arch and similar stuff? Nope, just don’t.
The wiki and man pages/tomes are your friend, and that’s it.

It’s been a while since I had to do a -Syyuu and that was when one of the mirrors I used got stale. So, big changes in mirrorlist = -Syyuu, databases broken = -Syyu, everything else, idk, haven’t suffered those yet.

After an arch install from archiso the system is usually up to date, and most of the time I either update weekly or when installing something and it’s missing from the repos because an update.

And of course, check news and issues, nobody wants to update to an hazardous environment in their daily driver after all, unless you like breaking things and have archiso for the rescue.

Thank you very much, that cleared it up! Yes I have used the Wiki to install Arch because you never know if something changed and how outdated a Youtube guide is.
Was just curious why this Youtuber does thison every of his Videos where he installs Arch.

Last edited by micronetic (2021-02-17 12:50:24)

Offline

#17 2021-02-17 14:02:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,520
Website

Re: [Solved] pacman -Syyu... I understand the what not the why.

micronetic wrote:

Was just curious why this Youtuber does thison every of his Videos where he installs Arch.

Because he doesn't have the slightest clue what he is doing, just like (almost?) every other "linux install" youtuber.  I don't quite understand why so many try to take some tactful or conflict-avoidance approach to advising against youtube videos for installation by saying they "may be out of date" - the fact is a vast majority of them were complete crap on the day they were made, being outdated has nothing to do with it.

Last edited by Trilby (2021-02-17 14:04:00)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#18 2021-02-19 19:18:59

othersamo_
Member
From: Braislava
Registered: 2020-10-26
Posts: 125

Re: [Solved] pacman -Syyu... I understand the what not the why.

computronium wrote:

I have read the fine manual. And after skimming through this forum I am not uncertain that this hasn't been asked/answered.

Passing two --refresh or -y flags will force a refresh of all package databases, even if they appear to be up-to-date

But why would one want to do that? In what scenarios will it be useful?

TIA!

I actually had pacman showing an error during installing a package. I tried pacman -Syu, error was still there, pacman -Syyu ran though... That error never happened again.


"Why join the navy if you can be a pirate?"
- Steve Jobs

Offline

Board footer

Powered by FluxBB