Results 1 to 8 of 8

Thread: Install updates, completely silent except for any errors

  1. #1
    Join Date
    Dec 2020
    Beans
    6

    Install updates, completely silent except for any errors

    Is there a command that will install all updates with no output at all except for errors? The use case is systems which automatically update themselves by running a suitable command as a cronjob and those who maintain the systems them only get an email about it if something goes wrong.

    I thought
    Code:
    apt-get -qq -y dist-upgrade && reboot
    would do it, but even though that appears to be maximum quiet it still emits a lot of information. I've been doing this for years on CentOS with
    Code:
    yum -y -e 0 -d 0 update && reboot
    but can't work out a Ubuntu version of that.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Install updates, completely silent except for any errors

    I don't do automatic updates on production systems, been burned, but it appears to be missing the required apt-get update command. Ubuntu is different from centos in that way.

    To be quiet, I'd just redirect the output for stdout and stderr to different files. Then if anything is in the stderr file, email that.

  3. #3
    Join Date
    May 2010
    Beans
    3,247

    Re: Install updates, completely silent except for any errors

    As stated by TheFu you need
    Code:
    sudo apt update
    to reread the reporistory information before new packages will be detected.

  4. #4
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,430
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: Install updates, completely silent except for any errors

    You don't need to reinvent the wheel unless you particularly want to; unattended upgrades is already a thing.

  5. #5
    Join Date
    Dec 2020
    Beans
    6

    Re: Install updates, completely silent except for any errors

    Quote Originally Posted by CatKiller View Post
    You don't need to reinvent the wheel unless you particularly want to; unattended upgrades is already a thing.
    As far as I can tell the unattended upgrades thing does not provide a way to reboot the system after the installation of updates and as such it's no use to me.

  6. #6
    Join Date
    May 2013
    Location
    Galiza
    Beans
    4,009
    Distro
    Ubuntu

    Re: Install updates, completely silent except for any errors

    Reboot typically is of no use for most updates anyway - this isn't Windows - but if you want to do the way you're used to then just correct the commands as indicated above.

  7. #7
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Install updates, completely silent except for any errors

    Quote Originally Posted by newbuntu2020 View Post
    As far as I can tell the unattended upgrades thing does not provide a way to reboot the system after the installation of updates and as such it's no use to me.
    No need to reboot, unless /var/run/reboot-required exists, which is only about once a month.
    Rebooting automatically is asking for trouble. Good luck with that.
    Last edited by TheFu; January 7th, 2021 at 03:28 PM.

  8. #8
    Join Date
    Dec 2020
    Beans
    6

    Re: Install updates, completely silent except for any errors

    Quote Originally Posted by CelticWarrior View Post
    Reboot typically is of no use for most updates anyway - this isn't Windows
    I am well aware that Linux is not Windows.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •