You are not logged in.

#1 2024-04-20 08:45:32

greenPillow
Member
Registered: 2024-04-20
Posts: 3

[SOLVED] Pacman fails to update at boot

I have downloaded, enabled cronie and set a cronjob:

su
systemctl enable cronie.service
crontab -e
@reboot /bin/pacman_syu.sh 

/bin/pacman_syu.sh:

#!/bin/bash
pacman -Syu --noconfirm

I have checked the /var/log/pacman, and it seems like the command has been sent:

[2024-04-20T11:01:36+0300] [PACMAN] Running 'pacman -Syu --noconfirm'
[2024-04-20T11:01:36+0300] [PACMAN] synchronizing package lists

These show up until the next reboot or once I use pacman.
So it's not a problem with cron. Is updating at boot not possible? if so, why?

Last edited by greenPillow (2024-04-20 14:35:16)

Offline

#2 2024-04-20 09:16:06

ua4000
Member
Registered: 2015-10-14
Posts: 558

Re: [SOLVED] Pacman fails to update at boot

maybe the network is not up ?
Desktop or server machine ?
A sleep 60s at the script beginning could be a workaround, better would be systemd unit which considers network online dependency.


Unattended upgrade with --noconfirm is not recommended. Be prepared for a not working/broken system.
Better would be: after your work is done, run the update script manually, e.g. once or twice a week, then reboot.

Offline

#3 2024-04-20 14:33:42

greenPillow
Member
Registered: 2024-04-20
Posts: 3

Re: [SOLVED] Pacman fails to update at boot

ua4000 wrote:

maybe the network is not up ?
Desktop or server machine ?
A sleep 60s at the script beginning could be a workaround, better would be systemd unit which considers network online dependency.


Unattended upgrade with --noconfirm is not recommended. Be prepared for a not working/broken system.
Better would be: after your work is done, run the update script manually, e.g. once or twice a week, then reboot.

Good catch! Thanks. It works with 'sleep 60'. I haven't debugged much, but the process might have ended before the network was up like you said.

Why isn't it a good idea? Till now I haven't much paid attention when doing pacman -Syu manually other than in some occasions.
Why should I pay more attention to it and how could this lead to a broken system?

Offline

#4 2024-04-20 14:38:21

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: [SOLVED] Pacman fails to update at boot

greenPillow wrote:

Why isn't it a good idea? Till now I haven't much paid attention when doing pacman -Syu manually other than in some occasions.
Why should I pay more attention to it and how could this lead to a broken system?

You are expected to read the Arch front page and perform any manual steps that may be required before or after an upgrade to avoid a broken upgrade.  Similarly such messages may also be present in pacman's output.

Offline

Board footer

Powered by FluxBB