You are not logged in.

#1 2022-11-03 09:04:30

d.ALT
Member
Registered: 2019-05-10
Posts: 328

Is ALWAYS using 'pacman -Syu packagename' wrong?

IF YOUR SYSTEM IS NOT UP TO DATE - YOU ARE DOING IT WRONG. PACMAN -Syu *BEFORE* POSTING

(https://bbs.archlinux.org/viewtopic.php?id=130309)

I wonder if always adopting this behavior ('pacman -Syu packagename') can help newbies avoid the problem of an outdated system. Is this a bad practice? What am I missing?

SYNC OPTIONS (APPLY TO -S)

[...]

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

[...]

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.

(https://man.archlinux.org/man/core/pacman/pacman.8.en)


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#2 2022-11-03 09:18:48

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

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

Depends, `pacman -S packagename` is enough until the package is not in the mirrors anymore, but that can be solved as well if necessary.
Overall the reason for `pacman -Syu packagename` is to avoid partial upgrades, that can be caused by `pacman -Sy packagename`.

I would no recommend `pacman -Syu packagename` for everything tho, sometimes you just want something new, instead of having to update everything and then potentially deal with whatever is new/changed and pacnews.

And of course, I don't have to explain that reporting a bug on old version when updated version is fixes is a pointless exercise right?


My reposSome snippets

Heisenberg might have been here.

Offline

#3 2022-11-03 09:33:34

d.ALT
Member
Registered: 2019-05-10
Posts: 328

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

GaKu999 wrote:

reporting a bug on old version when updated version is fixes is a pointless exercise right?

I dont' get this sentence (english is not my main language, sorry): how could a bug - related to of an old package - being reported when using '-Syu package'?


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#4 2022-11-03 09:38:01

Awebb
Member
Registered: 2010-05-06
Posts: 6,047

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

I always do this!

1. If you try to install a package and your sync database is old, you'll get a 404 on the old package URL, because the new package has a different file name (and rightly so).
2. To avoid that, you need to sync the database first, so -Sy packagename will install all the packages and NEW dependencies, but will not update existing packages that package might depend on.
3. -Syu packagename will make sure everything is up to date.

Downside:
- You might end up waiting longer.
- More traffic on your mirror.

In the past, I just "pacman -S package" and switched to "-Syu package" when something didn't work. This was when I was sitting in front of an Arch box for 10+ hours a day and had rather heavy package fluctuation. Nowadays, I mostly manage Arch servers, virtual machines and a WSL instance, so I probably update and install packages once a day.

Offline

#5 2022-11-03 09:43:33

d.ALT
Member
Registered: 2019-05-10
Posts: 328

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

<EDIT>
Typo.
I'm actually not using -u switch in the first instance. So the correct command is: # pacman -Sy --needed --noconfirm archlinux-keyring pacman
</EDIT>

To be sincere, personally I'm always going like this:

# pacman -Sy --needed --noconfirm archlinux-keyring pacman && pacman -Syu packagename

(see <EDIT> above in the post)

Last edited by d.ALT (2022-11-03 13:43:36)


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#6 2022-11-03 09:47:08

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,231
Website

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

d.ALT wrote:

To be sincere, personally I'm always going like this:

# pacman -Syu --needed --noconfirm archlinux-keyring pacman && pacman -Syu packagename

What?!

Offline

#7 2022-11-03 09:54:29

d.ALT
Member
Registered: 2019-05-10
Posts: 328

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

Allan wrote:
d.ALT wrote:

To be sincere, personally I'm always going like this:

# pacman -Syu --needed --noconfirm archlinux-keyring pacman && pacman -Syu packagename

What?!

Is it so bad? tongue


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#8 2022-11-03 11:09:32

seth
Member
Registered: 2012-09-03
Posts: 33,379

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

"--noconfirm" is bad, yes. Always.
"-u" completely contradicts the idea of pre-updating "archlinux-keyring" (and "pacman")
pre-updating pacman is russian roulette, if eg. if there's an ABI break in glibc etc. you just nuked your package manager - either you've pacman-static available or an install iso…

pacman -Sy archlinux-keyring && pacman -Syu [some new package]

should be fine unless the second paacman command fails for any reason (because your database is now out of sync) - but (should…) also no longer (be) necessary because of archlinux-keyring-wkd-sync.timer/archlinux-keyring-wkd-sync.service

Awebb wrote:

I just "pacman -S package" and switched to "-Syu package" when something didn't work

This.
Sometimes I'll blatantly update the database and update/install a single package this way, but "quod licet seth, non licet people who have to ask whether this is ok"
(I basically only do that w/ leafs, I record that I did that and I know that I won't have to ask on the forum if there's an unforseen consequence that changed/broke stuff than anticipated)

Offline

#9 2022-11-03 11:41:23

Awebb
Member
Registered: 2010-05-06
Posts: 6,047

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

seth wrote:
pacman -Sy archlinux-keyring && pacman -Syu [some new package]

Something wrong that's going to be fixed by updating archlinux-keyring is my most common "something wrong" on machines that I don't update at least once a month.  I wouldn't do this, however, because it re-installs archlinux-keyring, whether it is necessary or not. If you want this "clean", write some lines that check for an archlinux-keyring update and then decide, whether it'll be updated first and then -Syu or just -Syu.

EDIT: ... or use --needed, like OP did.

Last edited by Awebb (2022-11-03 11:43:57)

Offline

#10 2022-11-03 12:03:23

seth
Member
Registered: 2012-09-03
Posts: 33,379

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

There've been multiple instance over the past year where the keyring got dated rather fast, eg. https://bbs.archlinux.org/viewtopic.php … 7#p2033627 (but there've been more)
This lead to the forementioned archlinux-keyring-wkd-sync.timer/archlinux-keyring-wkd-sync.service what should™ deal w/ this so (as pointed out) this should™ no longer be relevant in general.

because it re-installs archlinux-keyring, whether it is necessary or not

Actually it warns and asks you, but you can always use --needed when installing packages.

But, again: this used to be a rare problem on rarely updated systems and when it recently became more frequent got mitigated otherwise so it should™ not be required to begin with.
It's just "fine" in the sense that you won't harm yourself or "unsync" the system this way (given the second pacman run completes)

Offline

#11 2022-11-03 13:49:43

d.ALT
Member
Registered: 2019-05-10
Posts: 328

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

seth wrote:

"--noconfirm" is bad, yes. Always.

Always?


seth wrote:

"-u" completely contradicts the idea of pre-updating "archlinux-keyring" (and "pacman")

Absolutely! It was a typo.


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#12 2022-11-03 14:14:20

seth
Member
Registered: 2012-09-03
Posts: 33,379

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

man pacman wrote:

       --noconfirm
           Bypass any and all “Are you sure?” messages. It’s not a good idea to do this unless
           you want to run pacman from a script.

Offline

#13 2022-11-03 14:23:13

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

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

To come back to the question in the title, the simple answer is "not at all wrong, it's perfectly okay".

If every time you want to instal $pkg, you run `pacman -Syu $pkg` you'll be fine and you'll present no excess burden to the mirrors*.  It is not always necessary and often it is also okay to just run `pacman -S $pkg`, but there isn't really any downside to always using `pacman -Syu $pkg`.  The only possible downside noted by Awebb is that it may take a little longer to get $pkg installed if there are other updates available.  But these would be updates you'd want soon enough anyways.

Note that I don't do this.  I generally just use `pacman -S $pkg` to install something new.  But I also run `pacman -Syu` often enough that I can probably count on 1 hand the number of 404 errors I've seen from and outdated local database (and that is over a decade of using arch as my only OS).

*note: if you regularly run `pacman -Syyu $pkg` you will present a burden to the mirrors.  But `pacman -Syu $pkg` will have identical results as `pacman -S $pkg` in any case where the local system is currently up to date (except for the check on the database timestamp to check if a new db is available, but this is trivial).

Last edited by Trilby (2022-11-03 14:25:18)


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

Offline

#14 2022-11-03 14:47:38

sekret
Member
Registered: 2013-07-22
Posts: 253

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

Trilby wrote:

But `pacman -Syu $pkg` will have identical results as `pacman -S $pkg` in any case where the local system is currently up to date (except for the check on the database timestamp to check if a new db is available, but this is trivial).

Agreed. BUT I have to add that updates in the repos happen quite often. I'm an update junkie (although less and less, personal growth big_smile) and I see a lot of repo updates, sometimes within minutes. So if everybody would use

pacman -Syu %pkg

all the time, the mirrors would recognize it, I guess.

Everything else has been said I guess, so nothing to add for me.

Last edited by sekret (2022-11-03 14:49:01)

Offline

#15 2022-11-03 15:30:59

d.ALT
Member
Registered: 2019-05-10
Posts: 328

Re: Is ALWAYS using 'pacman -Syu packagename' wrong?

Trilby wrote:

*note: if you regularly run `pacman -Syyu $pkg` you will present a burden to the mirrors.

I know. Good to point it out! Should this suggestion be added somewhere around into WIKI/pacman?


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

Board footer

Powered by FluxBB