diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a25381291ff2be1d94b2a9381ab385ba79295282..87c676141e1cfafb58b1d2dbfb211d29e5895bdb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,6 +18,7 @@ cache:
 before_script:
   - mkdir -p $R_LIBS_USER
   - echo "R_LIBS='$R_LIBS_USER'" > .Renviron
+  - R -q -e 'if (!require(remotes)) install.packages(c("remotes", "testthat"))'
   - R -q -e 'remotes::install_deps(dep = T)'
 
 test_all: