"Updates are available" MOTD on SSH

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
benjaminsherwood

"Updates are available" MOTD on SSH

Post by benjaminsherwood »

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? :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29459
Joined: Wed Jul 06, 2011 3:58 am

Re: "Updates are available" MOTD on SSH

Post by xenopeek »

Moving this here, as I think one of the regulars in this section would be able to share some thoughts on this.
Image
benjaminsherwood

Re: "Updates are available" MOTD on SSH

Post by benjaminsherwood »

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

Re: "Updates are available" MOTD on SSH

Post by benjaminsherwood »

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.
Jamesc359

Re: "Updates are available" MOTD on SSH

Post by Jamesc359 »

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 ?
thenewguy

Re: "Updates are available" MOTD on SSH

Post by thenewguy »

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
Locked

Return to “Scripts & Bash”