Check if a reboot is neccessary

there is a reboot needed if some packages are upgraded. E.g. kernel upgrades needs such a reboot, but there are some more. Because of some of my PCs do need a long time to reboot I want to look if a reboot is mandatory after an upgrade run. “checkupdates” tells me what packages are upgraded - but not if a reboot is mandatory. Is there a possibility to see if a reboot is needed BEFORE an upgrade run? In case of a reboot is needed pacman tells me “Inform user to reboot” - but I have not seen this message anywhere else except after an upgrade run…

if you are using our update notifier you will get a message on that everytime it is needed.

Hi Joe,

hmmmmm… I have some PCs which only have console - no desktop environment so I cannot use it there. And at the others I also get the message AFTER the upgrade has run. I want to get this information BEFORE the upgrade has run so that I can decide whether to ugrade now or wait until the eveniing just before shutdown the PC.

Then you need to create pacman post-install hook, with some conditions but i’m not entirely sure how to detect reboot need… :thinking:

Perhaps @anon31687413 or @tbg or @Root would know :slightly_smiling_face:

P.S. Pre-install might be a problem though

You could run the reboot at anytime convenient I guess.

Sometimes not, depends on update.
I had some breakages without doing so and continue to work

1 Like

Yes, I was thinking about both, too but I could not get information what pacman checks if a reboot is needed. Not onla kernel upgrades - that would be easy.

In general you are right, but in detail not. After such an upgrade it is possible that some hardware is out of access before you reboot.


Yep, Kernel one is obvious, also you can look up nvidia like here

But it’s not very universal, it would be cool to know some universal package-agnostic way to check…

Yes - and it would be very interesting to get the algorythm pacman uses. I have observed that sometimes (??!!??) a reboot is informed by pacman when systemd is upgraded - but not every time. Because I have not dig into pacmans source code I am not able to identify what pacman uses for getting reboot information.

You can assume reboot will be necessary if you’ve updated kernels, drivers, xorg, or any major parts of desktop environments.

How to know for certain whether reboot will be necessary before updating, I’m not sure. I guess you could do some fancy scripting: perform the update in a fakeroot environment and see whether it shows that reboot message. It’s a pretty bad solution, though, as it will be very slow.

checkupdates ?

checkupdates only refreshes the local package database in a fakeroot environment in order to give you the list of packages that are going to be updated. In order to know whether reboot will be necessary, I think it is necessary to perform the complete update (in a fakeroot environment, if that info is wanted before actually updating).

You can use pacman -Syuw to see all packages to be upgraded and only download them and do the upgrade later sometime , sorry it’s only a workaround :man_shrugging:

Still, that won’t show the message that reboot is necessary. You’ll see this message only after you do pacman -Su later.

So you may as well just use checkupdates, you get the same amount of info.

Then call an expert , probably ‘Bryanpwo’ :sweat_smile:

My main intention is the use on my server. I have swapped ~6 months ago from a Debian based server installation to Arch because I want to get rid off the version jumps of Debian with huge upgrade stress. Since I use Arch everything is quite up-2-date and all updates have performed without any problems. It is simply stable. But I cannot reboot server every time because of sometimes other customers are working on it. So I want to know what happens if I upgrade.

1 Like

There must be some better way.

I’ve noticed that in pacman.log reboots usually got reported by: ALPM-SCRIPTLET
Wonder what it is exactly :thinking:

P.S. @df8oe reason is totally legit, now i’m also really curious


If that’s your use case, just run yay every Saturday evening and reboot. Simple.

You don’t have to update every day.


Saturday evening would be a bad idea. That is the time most customers do have time and work on the server. In fact I cannot determine the time that is best for a reboot. I would take a look if someone is working and if not perform the upgrade and reboot. If no reboot is needed I can do it anytime.

It was an arbitrary example, reboot whenever you want to/can. :man_facepalming:

The point is, assume every update needs a reboot and only update when you can reboot. You don’t have to update every day (or even every week, twice a month will be sufficient).