PDA

View Full Version : [all variants] With *no* GUI, how do I know to restart after package update?



anarkhos
February 5th, 2010, 02:14 AM
I have a Ubuntu web server that I ssh into from time to time.

I run this:
sudo apt-get upgrade -y

to update the packages. When I do this on my desktop, I see a sometimes see a dialog notifying me I need to restart Ubuntu for changes to be completed. Is there a CLI way to see if Ubuntu needs to be restarted after updates?

Let's say that I didn't notice text saying `you need to restart` while I was doing the package upgrade. Is there a way to checking to see (say in a day or 2 after the upgrade) if the package manager is still waiting on a reboot?

Leppie
February 5th, 2010, 02:20 AM
you should only have to restart when you receive kernel updates.

anarkhos
February 5th, 2010, 03:52 AM
So a followup please. I would only need to reboot my server if I see a package called `linux-headers-xyz` in the upgrade list?

stlsaint
February 5th, 2010, 04:14 AM
Not really every single time you see headers being update but just to be on the safe side when you see the kernel being update or added to then go ahead and reboot but i rarely get updates that require me to reboot on my servers.

shriramrs31
February 5th, 2010, 12:17 PM
Let's say that I didn't notice text saying `you need to restart` while I was doing the package upgrade. Is there a way to checking to see (say in a day or 2 after the upgrade) if the package manager is still waiting on a reboot?

My understanding is that u need a restart only after kernel updates. In this case, since u are still working in the older kernel, you are in the safe side if you don't restart. you can keep working. If you want to log into the new kernel, you can restart and select the new kernel from boot menu.

Leppie
February 5th, 2010, 12:23 PM
if you want to avoid restarting for most kernel updates, you could install ksplice's uptrack: http://www.ksplice.com/
it's free for ubuntu.

anarkhos
February 6th, 2010, 03:58 AM
if you want to avoid restarting for most kernel updates, you could install ksplice's uptrack: http://www.ksplice.com/
it's free for ubuntu.
Very cool, thanks for suggesting that.

I found the download page at: http://www.ksplice.com/uptrack/download

tubasoldier
February 6th, 2010, 04:09 AM
Ksplice is great. And there isn't any real reason to restart your servers.

However, to answer your original question for future reference:


sudo shutdown -r now

the -r option will reboot the machine.
substitue the -h option and it will halt.

'now' is the time limit to shutdown/restart
you can set the time in minuites, say 30 or 90 if you want it to reboot/shutdown in a specified time.

I haven't read much about days but i'm sure there is a way to set the time limit for days. Or you can just use 1440 minuites per day.