• Setting up an auto system update

    From Vincent Coen@2:250/1 to All on Wednesday, October 05, 2022 18:34:40
    Hello All!

    Under Bullseye on primary system Pi 3B+ as a x86 (and Bullseye on Pi4 X64) -

    Pi 3B+ . . .
    I have as a cron job a simple /usr/bin/apt update

    I would like to replace it with upgrade but cannot find a way to do it as it requires a response to the msg (not exact) update [Y/n) etc.

    So I looked at a simple bash script that has :

    /usr/bin/apt upgrade << EOF
    Y

    but that does not work (because of the 2nd parameter to it so then tried : '/usr/bin/apt upgrade' << EOF that also produces an error.

    another attempt was:
    /usr/bin/apt upgrade
    read "Y"

    but that doesn't seem to cut it.

    Any one with a working solution ?

    Basically want to run this say weekly to ensure it is kept up to date as the system runs normally stand alone with one application written in Cobol - hey, I'm an old school prog back to the times of M/F's, mini's then S100 bus micros.



    Vincent

    --- Mageia Linux v8 X64/Mbse v1.0.8/GoldED+/LNX 1.1.5-b20180707
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1)
  • From Charles Blackburn@1:135/395 to Vincent Coen on Wednesday, October 05, 2022 14:37:17
    Re: Setting up an auto system update
    By: Vincent Coen to All on Wed Oct 05 2022 18:34:40

    Hello All!

    Under Bullseye on primary system Pi 3B+ as a x86 (and Bullseye on Pi4 X64) -
    Pi 3B+ . . .
    I have as a cron job a simple /usr/bin/apt update
    I would like to replace it with upgrade but cannot find a way to do it as it requires a response to the msg (not exact)
    update [Y/n) etc.

    So I looked at a simple bash script that has :

    /usr/bin/apt upgrade << EOF
    Y
    but that does not work (because of the 2nd parameter to it so then tried : '/usr/bin/apt upgrade' << EOF that also produces

    it won't work ... all you gott a do..... *drum roll*



    apt upgrade -y


    :D

    regards
    ===

    Charles Blackburn
    The F.B.O BBS 21:1/221 618:250/36
    bbs.thefbo.us IPV4/V6
    DOVE-Net FSX-Net MicroNET USENET
    --- SBBSecho 3.15-Linux
    * Origin: The FBO BBS - bbs.thefbo.us (1:135/395)
  • From Marco Moock@3:770/3 to All on Wednesday, October 05, 2022 21:15:23
    Am 05.10.2022 um 18:34:40 Uhr schrieb Vincent Coen:

    I have as a cron job a simple /usr/bin/apt update

    I would like to replace it with upgrade but cannot find a way to do
    it as it requires a response to the msg (not exact) update [Y/n) etc.

    Set up unattended-upgrades instead of your own script.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Martin Gregorie@3:770/3 to Vincent Coen on Wednesday, October 05, 2022 19:38:04
    On Wed, 05 Oct 2022 18:34:40 +1300, Vincent Coen wrote:

    Any one with a working solution ?


    echo "Y" | /usr/bin/apt upgrade

    Basically want to run this say weekly to ensure it is kept up to date as
    the system runs normally stand alone with one application written in
    Cobol - hey,
    I'm an old school prog back to the times of M/F's, mini's then S100 bus micros.

    Nowt wrong with COBOL (or stuff you never hear of these days such as the Sculptor 4GL). I wrote a lot of both on mainframes and minis - and thought
    they beat the crap out of PL/1 and (especially) RPG3.

    ======

    FWIW I wrote myself a scriptable menu handler in C (cribbed from Sculptor) which I run on my house server and use to drive my weekly backups. For
    these I use a cycle of two 1GB WD Elements USB drives, which normally live
    in a firesafe. One is taken out and connected to the house server when it
    is backup time. These systems run Redhat Fedora Linux.

    The menu handler uses rsync, run from a bash script, to make backups (in different root directories) for the house server, this laptop and anything
    else I think deserves backing up, immediately before upgrading each
    system.

    There are two copies of rsync used for this: the one on the system being
    backed up sends changes to the second one on the house server, which
    applies the changes to the USB drive. The whole process 'just works' and
    is fast because only changes are sent to the house server and applied to
    the backup disk.

    This also works equally well for backing up RaspberryPis: rsync is
    available for Raspbian.


    --

    Martin | martin at
    Gregorie | gregorie dot org

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lew Pitcher@3:770/3 to Martin Gregorie on Wednesday, October 05, 2022 19:50:26
    On Wed, 05 Oct 2022 19:38:04 +0000, Martin Gregorie wrote:

    On Wed, 05 Oct 2022 18:34:40 +1300, Vincent Coen wrote:

    Any one with a working solution ?


    echo "Y" | /usr/bin/apt upgrade

    yes | /usr/bin/apt upgrade

    Basically want to run this say weekly to ensure it is kept up to date
    as the system runs normally stand alone with one application written in
    Cobol - hey, I'm an old school prog back to the times of M/F's, mini's
    then S100 bus micros.

    //SYSIN DD *
    Ex-mainframe COBOL/Assembler programmer here. I hear you.
    /*

    --
    Lew Pitcher
    "In Skills, We Trust"

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Vincent Coen@2:250/1 to Charles Blackburn on Wednesday, October 05, 2022 22:04:13
    Hello Charles!

    Wednesday October 05 2022 14:37, you wrote to me:

    Re: Setting up an auto system update
    By: Vincent Coen to All on Wed Oct 05 2022 18:34:40

    Hello All!

    Under Bullseye on primary system Pi 3B+ as a x86 (and Bullseye on
    Pi4 X64) - Pi 3B+ . . . I have as a cron job a simple
    /usr/bin/apt update I would like to replace it with upgrade but
    cannot find a way to do it as it requires a response to the msg
    (not exact) update [Y/n) etc.

    So I looked at a simple bash script that has :

    /usr/bin/apt upgrade << EOF
    Y
    but that does not work (because of the 2nd parameter to it so
    then tried : '/usr/bin/apt upgrade' << EOF that also produces

    it won't work ... all you gott a do..... *drum roll*



    apt upgrade -y


    Thanks that works, now why could I not see that param - may be not in the man apt nor in info apt displays :)


    Vincent

    --- Mageia Linux v8 X64/Mbse v1.0.8/GoldED+/LNX 1.1.5-b20180707
    * Origin: Air Applewood, The Linux Gateway to the UK & Eire (2:250/1)
  • From Richard Kettlewell@3:770/3 to Lew Pitcher on Wednesday, October 05, 2022 22:45:58
    Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes:
    On Wed, 05 Oct 2022 19:38:04 +0000, Martin Gregorie wrote:
    On Wed, 05 Oct 2022 18:34:40 +1300, Vincent Coen wrote:
    Any one with a working solution ?


    echo "Y" | /usr/bin/apt upgrade

    yes | /usr/bin/apt upgrade

    apt-get has a -y option for this purpose.

    But the answer to the OP’s question is https://wiki.debian.org/UnattendedUpgrades

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Charles Blackburn@1:135/395 to Vincent Coen on Thursday, October 06, 2022 12:56:47
    Re: Setting up an auto system update
    By: Vincent Coen to Charles Blackburn on Wed Oct 05 2022 22:04:13

    it won't work ... all you gott a do..... *drum roll*
    apt upgrade -y
    Thanks that works, now why could I not see that param - may be not in the man apt nor in info apt displays :)

    it's buried in different man pages for sure, but is (i thought) common knowledge :D

    -y, --yes, --assume-yes
    Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively. If an undesirable situation, such as changing a held package, trying to install an unauthenticated
    package or removing an essential package occurs then apt-get will abort. Configuration Item: APT::Get::Assume-Yes.

    you can also do

    --assume-no
    Automatic "no" to all prompts. Configuration Item: APT::Get::Assume-No.

    and this will do everything OTHER than the actual install/update

    -s, --simulate, --just-print, --dry-run, --recon, --no-act
    No action; perform a simulation of events that would occur based on the current system state but do not actually change the system. Locking will be disabled (Debug::NoLocking) so the system
    state could change while apt-get is running. Simulations can also be executed by non-root users which might not have read access to all apt configuration distorting the simulation. A notice
    expressing this warning is also shown by default for non-root users (APT::Get::Show-User-Simulation-Note). Configuration Item: APT::Get::Simulate.

    Simulated runs print out a series of lines, each representing a dpkg operation: configure (Conf), remove (Remv) or unpack (Inst). Square brackets indicate broken packages, and empty square
    brackets indicate breaks that are of no consequence (rare).

    regards
    ===

    Charles Blackburn
    The F.B.O BBS 21:1/221 618:250/36
    bbs.thefbo.us IPV4/V6
    DOVE-Net FSX-Net MicroNET USENET
    --- SBBSecho 3.15-Linux
    * Origin: The FBO BBS - bbs.thefbo.us (1:135/395)