"Updates are available" MOTD on SSH

Forum rules
Before you post please read this

"Updates are available" MOTD on SSH

Postby benjaminsherwood on Thu Aug 02, 2012 7:09 am

Hi

I've spent since yesterday morning looking for an answer to this all over the internet, but have had to admit defeat. I don't know if I'm just phrasing my queries wrong or what, but... Anyway.

I have, at home, a Mint box and a Debian box. I'd noticed, as I've been using an SSH connection to tunnel my browsing at work out of my home connection via the Mint box, that when I SSH on, the server displays some kind of MOTD (not sure if it's PAM handling it or what?) that includes some information about available updates / security updates / upgrades. You'll probably all have seen this - I assume it's the default behaviour for Mint.

Now, I like that feature when logging in - it helps me remember to run check for updates each day. I thought it'd be a reasonably easy thing to configure it to work on my Debian box when I logged on there over SSH. I've looked at apt-get and aptitude, to see if there's anything built in there (the closest I got was considering that I could do:

Code: Select all
aptitude search "~U" | wc -l


which will give me the number of matched installed and upgradable packages - but it's certainly not as clean as the listing that's provided by Mint on login (which, by the way, looks suspiciously like a line out of "apt-get upgrade" anyways ("4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.", for example).


I hope this query makes sense... There must be a sensible way of achieving want I want here. Does anyone know how Mint currently does it? As I can't imagine it'd be that hard to implement Mint's process, to Debian.


I'm still relatively new to Linux so, be gentle? :)
benjaminsherwood
Level 1
Level 1
 
Posts: 3
Joined: Thu Aug 02, 2012 6:57 am

Linux Mint is funded by ads and donations.
 

Re: "Updates are available" MOTD on SSH

Postby xenopeek on Thu Aug 02, 2012 10:12 am

Moving this here, as I think one of the regulars in this section would be able to share some thoughts on this.
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14852
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: "Updates are available" MOTD on SSH

Postby benjaminsherwood on Thu Aug 02, 2012 10:29 am

Fair enough :) thought I best just go with the newbies section as I've not been using Linux for much, for too long.

This is the first thing that's really got me stumped, though... Fingers crossed someone will have some insight!
benjaminsherwood
Level 1
Level 1
 
Posts: 3
Joined: Thu Aug 02, 2012 6:57 am

Re: "Updates are available" MOTD on SSH

Postby benjaminsherwood on Mon Aug 06, 2012 6:58 am

Wow, no-one at all has any clue on this?

Surprises me, I didn't really think it was such a difficult question, but, not being able to find an answer anywhere on Google should probably have indicated that was the case.

Shame that no-one seems to know how it works on Mint at the moment... Might have to vanilla a mint install on to a VM and see if I can figure it out.
benjaminsherwood
Level 1
Level 1
 
Posts: 3
Joined: Thu Aug 02, 2012 6:57 am

Re: "Updates are available" MOTD on SSH

Postby Jamesc359 on Tue Aug 07, 2012 1:00 am

Strangely enough I don't have this on my system. So this is a shot in the dark, but have you looked at /etc/profile, /etc/bash.bashrc, ~/.bashrc, ~/.bash_profile, ~/.bash_login ?
“Gosh, you've... really got some nice toys here.”
User avatar
Jamesc359
Level 3
Level 3
 
Posts: 117
Joined: Sun May 06, 2012 1:42 pm

Re: "Updates are available" MOTD on SSH

Postby thenewguy on Fri Sep 07, 2012 1:40 pm

I think what the original poster is looking for is the script located at /usr/lib/update-notifier/apt-check

If you open your bashrc file ~/.bashrc and add the following line...
Code: Select all
/usr/lib/update-notifier/apt-check --human-readable

That should do the tricl
thenewguy
Level 3
Level 3
 
Posts: 189
Joined: Thu Feb 04, 2010 9:29 pm


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 2 guests