I run Ubuntu 12.04 and if the computer is started in console mode I get a notification of available updates when I log in. Is there a way to get this notification to show up in a (GUI) terminal window? What do I need to add to ~/.bashrc?
2 Answers
The message that you see is from a package called motd
aka message of the day
from ubuntu. There are files that can be modified to remove update notification, as well as put new welcome messages, run scripts that will fetch various information to display.
Take a look at this article on how to customize it.
-
1OK, thanks,
/usr/lib/update-notifier/update-motd-updates-available
is the command I'm looking for. However, it can't be run as non-root as it creates a file in/var/lib/update-notifier
. As far as I know you should be able to check for new updates without being root. Sep 19, 2012 at 14:26
There is a command called apt-check
. The following Bash script displays the number of updates if there are any:
updates=$(/usr/lib/update-notifier/apt-check --human-readable)
if [ ${updates:0:1} != 0 ]; then
echo -e "$updates"
fi