Setting up an auto system update

Oct 05, 2022 Last reply: 3 years ago 8 Replies

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

VC> Hello All!

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

VC> So I looked at a simple bash script that has :

VC> /usr/bin/apt upgrade << EOF VC> Y VC> but that does not work (because of the 2nd parameter to it so then tried : VC> '/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

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


Hello Charles!

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

VC>> Hello All!

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

VC>> So I looked at a simple bash script that has :

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

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

Vincent

Hello Marco!

Wednesday October 05 2022 21:15, you wrote to All:

Thanks for this now installed ald installed with crontab along with the other suggestion as a back up.

Now to remember to use mail to look at o/p :)

Vincent

Am 05.10.2022 um 18:34:40 Uhr schrieb Vincent Coen:

Set up unattended-upgrades instead of your own script.

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

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.

yes | /usr/bin/apt upgrade

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

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

But the answer to the OP’s question is

formatting link

Re: Setting up an auto system update By: Vincent Coen to Charles Blackburn on Wed Oct 05 2022 22:04:13

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

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required