package management – How can I tell, from the command line, whether the machine requires a reboot? – Ask Ubuntu

When you install certain updates (e.g. a new kernel) in Ubuntu Desktop, you get an indication that a reboot is required (in Lucid, the logout icon turns red).

How can I check, from the command line, whether an Ubuntu server requires a reboot?

I could grep for ‘System restart required’ in /etc/motd, but I’d like a solution that’s more elegant. Also, I want a solution that works in older releases, e.g. Hardy (8.04 LTS).

shareimprove this question
If you are maintaining server you will soon also develop sense wether or not update require restart. Most updates needs no restart or only restart of service (witch it should do automatically). – eXlin Nov 18 ’10 at 11:45

7 Answers

up vote199down voteaccepted

You can simply check if the file /var/run/reboot-required exists or not.

For example, any of these would tell you “no such file” or “file not found” if you do not need to reboot, otherwise (if you need to reboot) the file would exist and these commands would show information about the file:

file /var/run/reboot-required
stat /var/run/reboot-required
ls /var/run/reboot-required

In a bash script, you can use:

#!/bin/bash
if [ -f /var/run/reboot-required ]; then
  echo 'reboot required'
fi
shareimprove this answer
1
This works, and it works on Hardy too. (Doesn’t work on Dapper — 6.06 — which I still have on one machine. Tough.) Incidentally, the /var/run/reboot-required file is created by /usr/share/update-notifier/notify-reboot-required which is invoked from various packages’ maintainer scripts. – Marius Gedminas Jul 29 ’10 at 14:23
1
It would work on Dapper too if I installed the update-notifier package, except that it wants to pull down 120 megs’ worth of GNOME stuff into my ancient server. – Marius Gedminas Jul 29 ’10 at 14:27
9
Better install update-notifier-common, it doesn’t depend on any GUI stuff (but doesn’t exist for Dapper). – Marius Gedminas Jul 29 ’10 at 14:35
1
FWIW, update-notifier-common is not installed on Lucid server by default. – Marius Gedminas Jul 29 ’10 at 14:37
1
Thanks! and the file /var/run/reboot-required.pkgs will list the packages that require the reboot.– nealmcb Feb 22 ’15 at 17:21

In the package debian-goodies is a command named checkrestart which is quite useful. Its output can help you avoid a full reboot.

shareimprove this answer
How can it make me avoid a full reboot? – Oxwivi Sep 9 ’11 at 15:03
8
It tells you, which running applications have loaded shared libraries that were upgraded while the application was running. You then restart the applications and services manually and avoid a full reboot. Does not help with kernel upgrades, though. – aquaherd Sep 15 ’11 at 20:38
This should be the top answer. Very helpful. OpenSUSE got a tool built-in (and also helps you how can you run it). Shame Ubuntu just goes “restart, restart”. For example colord needed a restart here. Hence, no need to restart. – Shiki Mar 11 ’13 at 14:22

Normally if the file

/var/run/reboot-required 

exists you should reboot. You can see if this file is there by using this simple command in gnome-terminal.

ls /var/run/reboot-required
shareimprove this answer

Aswell as the most direct methods written by others there is a handy indication if you use byobu – a set of scripts to make GNU screen a little more user friendly. It shows a set of information at the bottom of the screen, and that can include whether a reboot is required – along with whether updates are available, the time, uptime, memory used …

In this screenshot you can see from the 199! on the bottom line with the red background that there are 199 updates available, and the ! means that some are security updates. The menu in the foreground is selecting which status notifications should be displayed.

If a reboot is required then this will be indicated by the symbol (R) displayed in the lower bar with white text on a blue background. More details and other indicators can be read about in thebyobu man page.

byobu screenshot

shareimprove this answer

The /etc/motd file gets its information about whether a reboot is required from /var/run/reboot-required file.

You can check the content of this file in terminal by using cat /etc/motd command

shareimprove this answer

If you have the reboot-notifier or update-notifier-common packages installed, then you get the files /var/run/reboot-required and /var/run/reboot-required.pkgs

reboot-notifier is newer in Ubuntu Wily and Xenial. Debian stretch, but in jessie-backports

update-notifier-common Is older, in all Ubuntu versions including Xenial and Debian Wheezy. Not in Debian Stretch or Jessie.

( There is some background to the reboot-notifier package athttps://feeding.cloud.geek.nz/posts/introducing-reboot-notifier/ )

If you don’t have these packages installed then you can compare the version of the linux package installed, with the version running:

tim@tramp:~$ dpkg -l linux-image-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                              Version               Architecture          Description
+++-=================================-=====================-=====================-=======================================================================
ii  linux-image-3.16.0-4-amd64        3.16.7-ckt20-1+deb8u4 amd64                 Linux 3.16 for 64-bit PCs
ii  linux-image-amd64                 3.16+63               amd64                 Linux for 64-bit PCs (meta-package)
tim@tramp:~$ more /proc/version
Linux version 3.16.0-4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian <b>3.16.7-ckt20-1+deb8u3</b> (2016-01-17)

You can see here that the latest installed kernel is 3.16.7-ckt20-1+deb8u4 but the kernel running is 3.16.7-ckt20-1+deb8u3. So this system needs a reboot. The u4 vs u3 right at the end.

You might need to scroll the box above. In the /proc/version, it is the version near the end of the line that matters.

The very minor version code change is typical of a Debian security kernel update

Source: package management – How can I tell, from the command line, whether the machine requires a reboot? – Ask Ubuntu

package management – How can I tell, from the command line, whether the machine requires a reboot? – Ask Ubuntu was last modified: July 13th, 2017 by Jovan Stosic

Why is “No new release found” when upgrading from a LTS to the next? – Ask Ubuntu

I’m following the upgrade instructions on Ubuntu’s website, but on launching the upgrade tool I get this response:

Checking for a new ubuntu release
No new release found

Am I doing something wrong? Is there a workaround?

Here’s my /etc/lsb-release:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.4 LTS"
shareimprove this question
1
There’s a really good answer by Jorge Castro. Why not mark it accepted? – fluffy Jul 7 ’16 at 9:38

4 Answers

According to Ubuntu Engineering Foundations team manager Steve Langasek:

Upgrades between LTS releases are not enabled by default until the first point release, 14.04.1, scheduled for July. It is recommended that most LTS users wait until then before upgrading to 14.04.

If you choose to upgrade before then, you can pass the -d option to the upgrade tool, running do-release-upgrade -d or update-manager -d, to upgrade from vanilla 12.04 to 14.04. (-d stand for devel)

This question explains the justification for waiting for the prompt.

shareimprove this answer
6
Why, then, is do-release-upgrade (without the -d) still saying “No new release found” a few days after the .1 has been released in iso form? (My /etc/update-manager/release-upgrades says “Prompt=lts”) – tudor Aug 1 ’14 at 1:00
5
From an inspection of the code, it seems that “normal” releases default to a URLchangelogs.ubuntu.com/meta-release which lists 14.04, and LTS releases use the URLchangelogs.ubuntu.com/meta-release-lts which doesn’t list it at all. I think they haven’t updated the meta information yet. – tudor Aug 1 ’14 at 1:28
2
That seems like a release oversight, can you file a bug and CC me? email is in my profile, thanks! – Jorge Castro Aug 1 ’14 at 3:20
1
@JorgeCastro Is this indeed a release oversight, and is there any idea when it will be fixe? Was a bug filed, and where can I follow it? (I searched, but could not find it. I also want to switch from 12.04 LTS to 14.04.1 LTS, and I just want to do it through the Update Manager.) – Marnix Klooster Aug 9 ’14 at 7:12
1

If one has no access to a GUI and wants the update on terminal:

  1. Edit
    /etc/update-manager/release-upgrades
    

    to match either normal or lts. (See list below what fits your case, be aware that you can only upgrade an lts to another lts version):

    [DEFAULT]
    Prompt=normal
    
  2. Test correct version is found, run
    do-release-upgrade -c
    
  3. Upgrade in case correct version is shown:
    sudo do-release-upgrade -d
    

That way I could upgrade a 12.04 to 12.10.

For the release-upgradesPrompt option never, normal, and lts are the available options:

  • never – Never check for a new release.
  • normal – Check to see if a new release is available. If more than one new release is found, the release upgrader will attempt to upgrade to the release that immediately succeeds the currently-running release.
  • lts – Check to see if a new LTS release is available. The upgrader will attempt to upgrade to the first LTS release available after the currently-running one. Note that this option should not be used if the currently-running release is not itself an LTS release, since in that case the upgrader won’t be able to determine if a newer release is available.
shareimprove this answer
2
I had a similar issue. I simply changed from Prompt=normal to Prompt=lts and it worked just fine for me. – Florin Coada Sep 9 ’14 at 10:48

sudo do-release-upgrade -d 

Notice the -d at the end.

Source: Why is “No new release found” when upgrading from a LTS to the next? – Ask Ubuntu

Why is “No new release found” when upgrading from a LTS to the next? – Ask Ubuntu was last modified: July 13th, 2017 by Jovan Stosic

Inferno (2016)

Directed by Ron Howard. With Tom Hanks, Felicity Jones, Irrfan Khan, Ben Foster. When Robert Langdon wakes up in an Italian hospital with amnesia, he teams up with Dr. Sienna Brooks, and together they must race across Europe against the clock to foil a deadly global plot.

Source: Inferno (2016) – IMDb

Inferno (2016) was last modified: September 25th, 2017 by Jovan Stosic

Alejandro Jodorowsky

Alejandro Jodorowsky Prullansky (Spanish: [aleˈxandɾo xoðoˈɾofski]; born 17 February 1929)[1][2][3]is a Chilean[4][5]-French film and theatre director, screenwriter, playwright, actor, author, poet, producer, composer, musician, comics writer, and spiritual guru. Best known for his avant-garde films, he has been “venerated by cult cinema enthusiasts” for his work which “is filled with violently surrealimages and a hybrid blend of mysticism and religious provocation”.[6]

Born to Jewish-Ukrainian and Polish parents in Chile, Jodorowsky experienced an unhappy and alienated childhood, and so immersed himself in reading and writing poetry. Dropping out of college, he became involved in theater and in particular mime, working as a clown before founding his own theater troupe, the Teatro Mimico, in 1947. Moving to Paris in the early 1950s, Jodorowsky studied mime under Étienne Decroux before turning to cinema, directing the short film Les têtes interverties in 1957. From 1960 he divided his time between Paris and Mexico City, in the former becoming a founding member of the anarchistic avant-garde Panic Movement of performance artists. In 1966 he created his first comic strip, Anibal 5, while in 1967 he directed his first feature film, the surrealistFando y Lis, which caused a huge scandal in Mexico, eventually being banned.

His next film, the acid western El Topo (1970), became a hit on the midnight movie circuit in the United States, considered as the first-ever midnight cult film, garnering high praise from John Lennon, which led to Jodorowsky being provided with $1 million to finance his next film. The result was The Holy Mountain (1973), a surrealist exploration of western esotericism. Disagreements with the film’s distributor Allen Klein, however, led to both The Holy Mountain and El Topo failing to gain widespread distribution, although both became classics on the underground film circuit.[6]

After an aborted attempt at filming Frank Herbert‘s 1965 science fiction novel Dune, Jodorowsky produced three more films, the family film Tusk (1980), the surrealist horror Santa Sangre (1989), and the failed blockbuster The Rainbow Thief (1990). Meanwhile, he has simultaneously written a series of science fiction comic books, most notably The Incal (1980–1989), which has been described as having a claim to be “the best comic book” ever written,[7] and also The Technopriests and Metabarons. Accompanying this, he has also written books and regularly lectures on his own spiritual system, which he calls “psychomagic” and “psychoshamanism” and which borrows from his interests in alchemy, the tarot, Zen Buddhism and shamanism.[8] His son Cristóbal has followed his teachings on psychoshamanism; this work is captured in the feature documentary Quantum Men, directed by Carlos Serrano Azcona.

Source: Alejandro Jodorowsky – Wikipedia

Alejandro Jodorowsky was last modified: September 25th, 2017 by Jovan Stosic

Null hypothesis

In inferential statistics, the term “null hypothesis” is a general statement or default position that there is no relationship between two measured phenomena, or no association among groups.[1] Rejecting or disproving the null hypothesis—and thus concluding that there are grounds for believing that there is a relationship between two phenomena (e.g. that a potential treatment has a measurable effect)—is a central task in the modern practice of science; the field of statistics gives precise criteria for rejecting a null hypothesis.

The null hypothesis is generally assumed to be true until evidence indicates otherwise. In statistics, it is often denoted H0 (read “H-nought”, “H-null”, or “H-zero”).

The concept of a null hypothesis is used differently in two approaches to statistical inference. In the significance testing approach of Ronald Fisher, a null hypothesis is rejected if the observed data are significantly unlikely to have occurred if the null hypothesis were true. In this case the null hypothesis is rejected and an alternative hypothesis is accepted in its place. If the data are consistent with the null hypothesis, then the null hypothesis is not rejected (i.e., accepted). In neither case is the null hypothesis or its alternative proven; the null hypothesis is tested with data and a decision is made based on how likely or unlikely the data are. This is analogous to a criminal trial, in which the defendant is assumed to be innocent (null is not rejected) until proven guilty (null is rejected) beyond a reasonable doubt (to a statistically significant degree).

In the hypothesis testing approach of Jerzy Neyman and Egon Pearson, a null hypothesis is contrasted with an alternative hypothesis and the two hypotheses are distinguished on the basis of data, with certain error rates.

Proponents of each approach criticize the other approach. Nowadays, though, a hybrid approach is widely practiced and presented in textbooks. The hybrid is in turn criticized as incorrect and incoherent—for details, see Statistical hypothesis testing.

Statistical inference can be done without a null hypothesis, by specifying a statistical model corresponding to each candidate hypothesis and using model selection techniques to choose the most appropriate model.[2](The most common selection techniques are based on either Akaike information criterion or Bayes factor.

Source: Null hypothesis – Wikipedia

Null hypothesis was last modified: September 25th, 2017 by Jovan Stosic

A/B testing

In marketing and business intelligence, A/B testing is a term for a randomized experiment with two variants, A and B, which are the control and variation in the controlled experiment.[1] A/B testing is a form of statistical hypothesis testing with two variants leading to the technical term, two-sample hypothesis testing, used in the field of statistics. Other terms used for this method include bucket tests and split-run testing. These terms can have a wider applicability to more than two variants, but the term A/B testing is also frequently used in the context of testing more than two variants. In online settings, such as web design (especially user experience design), the goal of A/B testing is to identify changes to web pages that increase or maximize an outcome of interest (e.g., click-through rate for a banner advertisement). Formally the current web page is associated with the null hypothesis. A/B testing is a way to compare two versions of a single variable typically by testing a subject’s response to variable A against variable B, and determining which of the two variables is more effective.[2]

As the name implies, two versions (A and B) are compared, which are identical except for one variation that might affect a user’s behavior. Version A might be the currently used version (control), while version B is modified in some respect (treatment). For instance, on an e-commerce website the purchase funnel is typically a good candidate for A/B testing, as even marginal improvements in drop-off rates can represent a significant gain in sales. Significant improvements can sometimes be seen through testing elements like copy text, layouts, images and colors,[3]but not always. The vastly larger group of statistics broadly referred to as multivariate testing or multinomial testing is similar to A/B testing, but may test more than two different versions at the same time and/or has more controls, etc. Simple A/B tests are not valid for observational, quasi-experimental or other non-experimental situations, as is common with survey data, offline data, and other, more complex phenomena.

A/B testing has been marketed by some as a change in philosophy and business strategy in certain niches, though the approach is identical to a between-subjects design, which is commonly used in a variety of research traditions.[4][5][6] A/B testing as a philosophy of web development brings the field into line with a broader movement toward evidence-based practice. The benefits of A/B testing are considered to be that it can be performed continuously on almost anything, especially since most marketing automation software now, typically, comes with the ability to run A/B tests on an on-going basis. This allows for updating websites and other tools, using current resources, to keep up with changing trends.

Source: A/B testing – Wikipedia

A/B testing was last modified: September 25th, 2017 by Jovan Stosic

Mario Del Monaco

Mario Del Monaco

From Wikipedia, the free encyclopedia
Mario Del Monaco
A black-and-white picture of the artist.
Born 27 July 1915
Florence, Italy
Died 16 October 1982 (aged 67)
Mestre, Italy
Occupation Opera singer (tenor)
Years active 1940 – 1975

Mario Del Monaco (27 July 1915 – 16 October 1982)[1] was an Italian operatic tenor who earned worldwide acclaim for his powerful voice.

Source: Mario Del Monaco – Wikipedia

Mario Del Monaco was last modified: September 25th, 2017 by Jovan Stosic

Carlo Bergonzi

Carlo Bergonzi (13 July 1924 – 25 July 2014) was an Italian operatic tenor. Although he performed and recorded some bel canto and verismo roles, he was above all associated with the operas of Giuseppe Verdi, including a large number of the composer’s lesser known works that he helped revive. Additionally, he sang more than 40 other roles throughout his career. Bergonzi is considered one of the 20th century’s most distinguished operatic tenors.

Source: Carlo Bergonzi – Wikipedia

Carlo Bergonzi was last modified: September 25th, 2017 by Jovan Stosic