diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a2e8aa5c76a347a40d33bea3d1175d60176f3316..b0f641e4b784b9ddbe437e089a62e436fbb1ec43 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -87,5 +87,6 @@ release:pip:ubuntu:
 
   after_script:
     # Ensure all files are owned by the correct user at the end of the job
-    - chown -R $(whoami):$(whoami) .
+    # Note: sudo requires the job to have privileged = true
+    - sudo chown -R $(whoami):$(whoami) .