I have read the answers in this post but it doesn't seem to work for my problem.
I am executing a bash script via stdin from wget:
wget -O - http://serverip/subfolder/script | sudo bash
I've tried using apt-get -y --force-yes install <packages..> || true
, but it still exits the script if the one of the listed is installed by apt-get.
It doesn't exit the script if all the listed packages are already installed.
The same thing happens if I have a apt-get upgrade
and it installs package(s). It will exit the script.
I have another set of scripts, that seems to work. In that scenario, the install script is just a stub, that downloads, runs the script via bash <scriptname>
then deletes the script. The script itself will elevate its privilege by sudoing itself. apt-get
works as expected here.
Any insight as to how to prevent apt-get
from terminating the script would be appreciated.