Random question: How often do you update your packages?

I believe the technical term for this is “yolo update” :rofl:

I think it is fairly safe to go up to 6 months without updating on an Arch system. There might be some minor problems and some manual intervention required after not updating for so long, though. And if it is much longer than that, it’s probably just easier to reinstall.

My record is some three months without updating on Manjaro Stable, the “yolo update” was pretty big, but quite uneventful.

3 Likes

I update every day, some days multiple times, including my work machine - living dangerously perhaps - but I haven’t had major issues with that approach from Antergos days.
Well asides from nvidia driver malarkey.
There was a hiccup (nvidia driver related) when 5.8 was deployed, I read this forum on a daily basis and was prepared :slight_smile: and got it working in short while.

2 Likes

I had an old laptop that I hadn’t touched in ~2 years that had Arch on it. I Managed to successfully update it after sorting out the PGP key issues I had but aside from that it was rather uneventful.

3 Likes

But it is a fair check as any of these could potentially require a reboot.

And from the mentioned thread you basically mimicked the Endeavour check - and it aligns nice with my own observations.

On Manjaro I usually recommend doing updates from TTY if the updates include any of these packages - as xorg, systemd and nvidia updates can be challenging if Xorg breaks in the middle of the update process.

2 Likes

My laptop i dont often use only go to the camping i update it before i go, or in 3 a 4 weeks…once i broke it when battery goes out middle in the update but by chrooting fixing it :slight_smile:

for myself dont know sometimes i update directly and sometimes i wait some days. depends whats up coming.

some users does do update wednesday and update saturday , just when they have bit more time in stock. is just our own choice :slight_smile:

3 months jump update can do but you never know what comes in between but a year or 2 is much riky but doesnt tell is not doable :slight_smile: but a pain in the finger to correct it :slight_smile:

1 Like

Yeah, I’ve done that too, many years ago when I was still using windoze. Unlike Arch, where just updating again in a chroot typically fixes that problem, on windoze that typically means reinstalling everything.

But these are two great lessons to learn: plug your laptop in before updating, and use a normal operating system, not windoze. :wink:

3 Likes

btw to me it haven’t been happening on Manjaro last year, both pamac and pacman now works pretty mature in that regards :slight_smile:

Still good recommendation anyway, just in case for full bulletproof :upside_down_face:

1 Like

It all works fine - until it doesn’t. Last time there was a problem, everything was working fine for more than a year, then Pamac crashed during an update due to (I think) a glibc update, and that broke a lot of installations.

I simply don’t trust Pamac with system upgrades. Basic package installation and removal, yes, but big system updates? No, thank you.

8 Likes

I was thinking of this recently: if I am updating via TTY, let’s say on TTY2, and I have a graphical session running on TTY1, should I log out of that session totally before running the update in TTY2, or does it not matter? I usually just switch back to TTY1 after having updated.

systemctl isolate multi-user.target (formerly known as runlevel 3) is the “systemd” way to close your graphical session.
To bring it back: systemctl isolate graphical.target

To be honest though, I don’t think this is really needed.

2 Likes

I usually update the packages I use on a daily basis after they become available. Of course, I’m mostly informed before that if there’s a problem with them, but my one year of experience shows that so far there hasn’t been a memorable case for a broken package.

Wouldn’t it be worth merging these threads?

I would say it doesn’t matter - however - one might like so save any unsaved work - before venturing into updating.

1 Like

zoli62
Thank you for the question. In some cases I would say yes. In this case listing the other topics (threads) more or less accomplished that without being too authoritative. I prefer to keep things as friendly as possible.

Also, in this case the user can either check out the older topics if they haven’t read these topics yet, or ignore them if they have already read those topics in the past.

Pudge

EDIT:
If you click on the link “Update frequency” in my original post, it will take you to that topic. In that topic will be a link back to this topic. So it is kind of merged by the forum software when using links to topics. Think of the different topics as topic Vol. 1, Vol 2, and Vol 3.

2 Likes

I check every day but update if one of three options is met:

A new browser version, a new kernel version or if the updates reach > 300 Mb.

1 Like

I’ve just tried to apply your mogrified version of the code to my alias (function), and I got to look at it in more detail so I noticed it only checks for the first element in the array $reboot (which is “ucode”), and never any other. I might be misunderstanding something, but this code, as it is written, does not work properly, it will print “Needs reboot” only when there is an update to “ucode”.

Also, even if it checked for all the elements in the array, it would not work for “linux-lts”, for example, since in that one, “linux” does not end with a space or end of the word.

This version, however, works fine:

#!/bin/bash
UPDATES=$(checkupdates; yay -Qua)
[[ "$UPDATES" == "" ]] || echo "$UPDATES"  # no need to print a blank line if no updates
REBOOT=(ucode cryptsetup linux nvidia mesa systemd wayland xf86-video xorg)
for i in ${REBOOT[@]}; do
  if [[ $UPDATES =~ $i ]]; then
    echo "Needs reboot"
    exit 0; # no need to print the message multiple times
  fi
done

EDIT: I’ve now removed

alias cu="checkupdates; yay -Qua"

from my .zshrc and replaced it with this function:

Details
cu() { # check for updates, requires "pacman-contrib" and "yay"
  local UPDATES=$(checkupdates; yay -Qua)
  [[ "$UPDATES" == "" ]] && return 2 || echo "$UPDATES" 
  
  # assume packages containing these strings in name need reboot after updating
  local REBOOT="(ucode|cryptsetup|linux|nvidia|mesa|systemd|wayland|xf86-video|xorg|plasma|sddm)"

  if [[ $UPDATES =~ $REBOOT ]]; then
    echo -n "\nWarning: reboot after updating, just in case.\n"
    return 1
  fi
  return 0
}

EDIT: improved the function by implementing suggestions by @linux-aarhus

4 Likes

You maybe right. I didn’t know these threads that you quoted before either. Is the forum engine smart enough to add links to topics with similar titles to the topic’s starting post?

The forum engine does not do this on it’s own. If you manually put a link to another topic in a post, then both topics will be linked to each other.

Pudge

Really, now I checked on one of the threads I created, it’s a very good feature, thank you. :+1:

1 Like

I can see I bugged with the regex - it should have been

reboot="(ucode|cryptsetup|linux|nvidia|mesa|systemd|wayland|xf86-video|xorg)"

Then this check

[[ $updates =~ "$reboot" ]]

I tested with https://regex101.com/r/A5wv9k/1 - and I can’t see why bash won’t parse it.


Edit got it … never quote the regex :man_facepalming:

#!/usr/bin/env bash
reboot="(ucode|cryptsetup|linux|nvidia|mesa|systemd|wayland|xf86-video|xorg)"
updates=$(checkupdates)
echo "$updates"
if [[ $updates =~ $reboot ]]; then
    echo "Needs reboot .."
fi

Your function

cu() { # check for updates, needs "pacman-contrib" and "yay"
  local UPDATES=$(checkupdates; yay -Qua)
  [[ "$UPDATES" == "" ]] && return 2 || echo "$UPDATES" 
  # assume packages containing these strings in name need reboot after updating
  local REBOOT="(ucode|cryptsetup|linux|nvidia|mesa|systemd|wayland|xf86-video|xorg)"
  if [[ $UPDATES =~ $REBOOT ]]; then
    echo -n "\nWarning: reboot after updating, just in case.\n"
    return 1
  fi
  return 0
}

2020-08-25T06:50:00Z EDIT: Refactored to work if yay is not installed

#!/usr/bin/env bash
reboot="(ucode|cryptsetup|linux|nvidia|mesa|systemd|wayland|xf86-video|xorg)"
if [[ $(which yay) =~ (yay) ]]; then
    updates=$(checkupdates; yay -Qua)
else
    updates=$(checkupdates)
fi
echo "$updates"
if [[ $updates =~ $reboot ]]; then
    echo "Updating possibly requires system restart ..."
fi

Cross posted to Manjaro Forum

1 Like