diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6bdcf45a537aa847494f5fdf4efe8b592f40d0bd..6b78ee694760fdb140721992532062678ef46cce 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -28,7 +28,7 @@ code-style:
   tags: [ docker ]
   script:
     # install git
-    - apt-get install git
+    - apt-get update && apt-get install git
     # install JuliaFormatter
     - julia  -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
     # try and format the files