Skip linux-image-extra-$(uname -r) on 18.04

Seems like aforementioned package is not available on Ubuntu 18.04
(Bionic). This commit excludes that version from installation of Docker.

Change-Id: Ib1864497dd19caadf9077386ce278712e4f5de8f
This commit is contained in:
Michał Dulko 2018-11-27 10:47:22 +01:00
parent 6d65af2900
commit 17a865e064
1 changed files with 6 additions and 4 deletions

View File

@ -49,10 +49,12 @@ function install_docker {
local dist_version=${os_CODENAME}
local arch=$(dpkg --print-architecture)
if is_ubuntu; then
if uname -r | grep -q -- '-generic' && dpkg -l 'linux-image-*-generic' | grep -qE '^ii|^hi' 2>/dev/null; then
apt_get install linux-image-extra-$(uname -r) linux-image-extra-virtual
else
(>&2 echo "WARNING: Current kernel is not supported by the linux-image-extra-virtual package. Docker may not work.")
if [[ ${dist_version} == 'trusty' ]]; then
if uname -r | grep -q -- '-generic' && dpkg -l 'linux-image-*-generic' | grep -qE '^ii|^hi' 2>/dev/null; then
apt_get install linux-image-extra-$(uname -r) linux-image-extra-virtual
else
(>&2 echo "WARNING: Current kernel is not supported by the linux-image-extra-virtual package. Docker may not work.")
fi
fi
apt_get install apt-transport-https ca-certificates software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -