We are installing google-chrome-stable in databricks cluster using apt-get install. Which has been working fine for a long time, but since the past few days it has started to fail intermittently.
The following is the code that we run.
%sh
sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
sudo echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
sudo apt-get -y update
sudo apt-get -y --fix-missing install google-chrome-stable
The following is the error we see.
After this operation, 329 MB of additional disk space will be used.
Err:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 udev amd64 245.4-4ubuntu3.18
404 Not Found [IP: 185.125.190.39 80]
Unable to correct missing packages.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:1 and /etc/apt/sources.list.d/google-chrome.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:1 and /etc/apt/sources.list.d/google-chrome.list:2
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:1 and /etc/apt/sources.list.d/google-chrome.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:1 and /etc/apt/sources.list.d/google-chrome.list:3
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:1 and /etc/apt/sources.list.d/google-chrome.list:4
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:1 and /etc/apt/sources.list.d/google-chrome.list:4
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/udev_245.4-4ubuntu3.18_amd64.deb 404 Not Found [IP: 185.125.190.39 80]
E: Aborting install.
was trying to reinstall the package if failure occured using the follow code
%sh
i=0
while true;
echo "inside while loop"
sudo add-apt-repository --remove ppa:vikoadi/ppa
sudo apt-get -y --fix-missing install google-chrome-stable
do
if [ $(google-chrome --version| grep -c "Google Chrome") -gt 0 ]; then
echo "chrome installed"
break;
else
echo "chrome not installed trying another attempt"
echo "sleeping"
sleep 10000
fi
i=$((i+1))
if [ i -gt 3]; then
echo "max attempts tried"
break;
fi
done
But the above logic did not work because - while loop breaks on installation failure.
Any help would be appreciated