diff --git a/mpcdf_common.py b/mpcdf_common.py
index f1ed96f81a96a1026754426dd3c671fbb4fcc61a..8323a0dd8d30032f9943b18141123ed0b3ecbed4 100644
--- a/mpcdf_common.py
+++ b/mpcdf_common.py
@@ -194,10 +194,10 @@ def mpcdf_setup_repos(api_url, project, distribution, parent=None, packages=None
             p.set("repository", repo)
             p.tail = "\n    "
 
-        if parent:
-            path(parent, name)
         for dep_project, dep_repo in dependencies:
             path(dep_project, dep_repo)
+        if parent:
+            path(parent, name)
 
         for arch in architectures:
             a = ElementTree.SubElement(r, "arch")