diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index debb9b2bccff8fc1c19dce3beecc626c5282afdc..7ec9a8b0510be2f3b25b65c99513f0750656d7ef 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -32,7 +32,7 @@ test:frontend:
   stage: test
   coverage: '/(\d+.\d+) \% covered/'
 
-.test_backend_commons_template: 
+.test_backend_commons_template:
   script: &test_backend_commons_definition
 #xvfb is for X11 connection used by some parts of the java code: https://stackoverflow.com/a/47575851/1127920
     - apt-get update
@@ -325,7 +325,7 @@ build_debian_package:
     - debian/create-debian-pkg.sh
 
 test_upgrade_debian_package:
-  image: debian
+  image: debian:stretch
   stage: test
   only:
     - tags
@@ -362,7 +362,7 @@ test_upgrade_debian_package:
 
 #local repository with new version
      - apt-add-repository "deb http://debian-repo/ unstable main"
-     - apt-get update
+     - apt-get update --allow-unauthenticated
      - apt-get dist-upgrade -y --allow-unauthenticated
      - mv /usr/sbin/policy-rc.d.backup /usr/sbin/policy-rc.d
      - service tomcat8 start
@@ -376,7 +376,7 @@ test_upgrade_debian_package:
      - test 1 = $(cat configuration.json| grep $version | wc -l)
 
 test_install_debian_package:
-  image: debian
+  image: debian:stretch
   stage: test
   only:
     - tags