You are not logged in.

#1 2023-03-03 03:52:43

ArcWand
Member
Registered: 2023-01-19
Posts: 4

What are the downsides to running pacman -Syu as a cronjob?

It's fairly easy to run pacman -Syu as a cronjob. There's even [a thread](https://bbs.archlinux.org/viewtopic.php?id=1307) about it. However, the thread doesn't go into much detail on why this is bad. I'm fairly new to linux, but as a gut instinct doing this feels like it could cause issues. I just don't know what issues. Could someone enlighten me?

Last edited by ArcWand (2023-03-03 03:53:16)

Offline

#2 2023-03-03 04:22:46

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: What are the downsides to running pacman -Syu as a cronjob?

1. It removes the agency and responsibility of the user from the update process. This isn't Windows.

2. It will break when pacman asks you to make a decision [Y/N] or when user intervention is required (rare, but it happens).

3. Why would you do it anyway? Is your life that busy that you don't have time to pay attention to what is happening on your machine(s)?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2023-03-03 04:36:56

vorvac
Member
Registered: 2021-05-14
Posts: 44

Re: What are the downsides to running pacman -Syu as a cronjob?

What are the benefits? There are far too many downsides to list.

https://wiki.archlinux.org/title/Pacman … re_created

Offline

#4 2023-03-03 04:51:08

Brocellous
Member
Registered: 2017-11-27
Posts: 161

Re: What are the downsides to running pacman -Syu as a cronjob?

Hard agree on "Why would you even want this". If you're just trying not to wait for packages to download try using checkupdates, there's hardly any legitimate reason to actually to to install packages unattended though.

Offline

#5 2023-03-03 04:57:39

ArcWand
Member
Registered: 2023-01-19
Posts: 4

Re: What are the downsides to running pacman -Syu as a cronjob?

The idea behind this is pretty simple and probably more than a little dumb: I'm very forgetful; too often, I've had software break because I hadn't updated in too long. So, an automatic update every other week or so would fix that.

Pacman asks me for [Y/n] at least once per run. It's bypassable by piping `yes y` into the pacman command.

Vorvac, I'm not sure how the wiki page linked explains the downsides?

Offline

#6 2023-03-03 05:17:58

Brocellous
Member
Registered: 2017-11-27
Posts: 161

Re: What are the downsides to running pacman -Syu as a cronjob?

1. Unattended upgrades cannot consider manual intervention news.

2. Unattended upgrades cannot deal with .pacnew files.

3. Unattended upgrades cannot reliably restart running processes or services that use the upgraded binaries, libraries, configs, unit files, etc. which were replaced. Mixing these at runtime is definitely asking for trouble.

4. Unattended upgrades cannot review pacman transactions, which is a moderate security risk.

5. Unattended upgrades may require a reboot, such as in the case of removed kernel modules. This is true of regular upgrades but you have the option to defer them by declining the proposed updates.

And, again, you have the option to just never update. In that case all your software will continue to operate the same as it has the day before, and the day before that. I have no idea what spontaneous breakage you're thinking of, but it is just is not a real concern. If you run periodic unattended upgrades I can promise you you will encounter spontaneous and difficult to identify issues. It just isn't that much work to look at a list of packages and consider what the consequences of the upgrade are.

Offline

#7 2023-03-03 05:19:12

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: What are the downsides to running pacman -Syu as a cronjob?

ArcWand wrote:

The idea behind this is pretty simple and probably more than a little dumb: I'm very forgetful; too often, I've had software break because I hadn't updated in too long. So, an automatic update every other week or so would fix that.

Or, you could just display any pending updates in your status bar...

ArcWand wrote:

Pacman asks me for [Y/n] at least once per run. It's bypassable by piping `yes y` into the pacman command.

This is an idea that is so stupendously stupid. What happens when pacman recommends [y/N]?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2023-03-03 05:36:39

ArcWand
Member
Registered: 2023-01-19
Posts: 4

Re: What are the downsides to running pacman -Syu as a cronjob?

Thank you to every one who responded! Definitely many reasons to not do this!

Offline

#9 2023-03-03 07:31:37

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

Re: What are the downsides to running pacman -Syu as a cronjob?

<EDIT>
See Brocellous' #10 and #14 posts
See Trilby's post #15
</EDIT>

You'd maybe want some help by automating the download phase: -Syuw. Did you consider it?

Last edited by d.ALT (2023-03-03 17:14:30)


<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

#10 2023-03-03 07:34:01

Brocellous
Member
Registered: 2017-11-27
Posts: 161

Re: What are the downsides to running pacman -Syu as a cronjob?

d.ALT wrote:

-Syuw. Did you consider it?

Not if you ever want to use pacman -S. Use checkupdates -d instead.

Offline

#11 2023-03-03 07:36:37

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

Re: What are the downsides to running pacman -Syu as a cronjob?

Brocellous wrote:
d.ALT wrote:

-Syuw. Did you consider it?

Not if you ever want to use pacman -S

I'm missing this, can you please help me understand?


<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 2023-03-03 07:46:15

Brocellous
Member
Registered: 2017-11-27
Posts: 161

Re: What are the downsides to running pacman -Syu as a cronjob?

Every invocation of -Sy refreshes your dbs, meaning -S $pkg could introduce a partial upgrade. If any $dep of $pkg has been updated in the repos since your last -Su you won't have the correct version of $dep present for $pkg.

Offline

#13 2023-03-03 07:58:33

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

Re: What are the downsides to running pacman -Syu as a cronjob?

Brocellous wrote:

If any $dep of $pkg has been updated in the repos since your last -Su

So... Problem here it's the time delay which will occour between download-only (-Syuw) and actual upgrade (-Syu), am I understanding right?


<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

#14 2023-03-03 08:08:18

Brocellous
Member
Registered: 2017-11-27
Posts: 161

Re: What are the downsides to running pacman -Syu as a cronjob?

Yes, it's because the refresh and upgrade happen at different times. Frequent -Syuw in the background means your syncdb is usually more up to date than your installed packages. checkupdates uses a separate syncdb to check for updates in order to keep your real syncdb in sync with your real system.

Offline

#15 2023-03-03 14:03:22

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

Re: What are the downsides to running pacman -Syu as a cronjob?

d.ALT wrote:

Problem here it's the time delay which will occour between download-only (-Syuw) and actual upgrade (-Syu), am I understanding right?

Not really.  You can download package files to your hearts content and delay as long as you want until using them in an upgrade, or never use them at all.  The problem is the delay between syncing your local dbs (the -y flag) and installing the packages in that version of the dbs.  It's the very definition of a partial upgrade.

On the main topic though, some ideas are so bad it's just futile trying to list all the different ways it could do harm.  Some good examples have been provided, but that's not nearly an exhaustive list.  Many of the breakage that could result from unatended updates may not even be able to be predicted.  Even the process of trying to list all the ways this could go wrong is a perfect example of the second dumbest idea in computer security.  Even if you were to think all the problems we could list wouldn't be an issue for you that would not mean it was safe or wise to go ahead with unattended updates.

Last edited by Trilby (2023-03-03 14:07:06)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#16 2023-03-03 16:13:29

vorvac
Member
Registered: 2021-05-14
Posts: 44

Re: What are the downsides to running pacman -Syu as a cronjob?

ArcWand wrote:

I've had software break because I hadn't updated in too long. So, an automatic update every other week or so would fix that.


Vorvac, I'm not sure how the wiki page linked explains the downsides?

The page I linked to describes how pacman handles configuration files when upgrading packages. If you are worried about software breaking from lack of updates, automating pacman -Syu won't solve your problem -- as you haven't prevented software from breaking due to updates.

Last edited by vorvac (2023-03-03 16:17:50)

Offline

Board footer

Powered by FluxBB