diff --git a/get_deps_rpkg.sh b/get_deps_rpkg.sh
index 1e17ba3738d9300f0ede805194f5e2c57ce04a2f..e4fed9eaf0af16171cb2d7f41a2327c0a217525e 100755
--- a/get_deps_rpkg.sh
+++ b/get_deps_rpkg.sh
@@ -32,15 +32,18 @@ do
     fi
 done
 
-while read -r pkg
-do apt depends "$pkg"
-done < /install-candidates | grep Depends | awk '{ print $2}' | sort -u >> /dependencies
-
-while read -r pkg
-do grep -q "$pkg" /dependencies || INSTALL+=("$pkg")
-done < /install-candidates
-
-apt-get install -qqy "${INSTALL[@]}"
+if [[ -f /install-candidates ]]
+then
+    while read -r pkg
+    do apt depends "$pkg"
+    done < /install-candidates | grep Depends | awk '{ print $2}' | sort -u >> /dependencies
+
+    while read -r pkg
+    do grep -q "$pkg" /dependencies || INSTALL+=("$pkg")
+    done < /install-candidates
+
+    apt-get install -qqy "${INSTALL[@]}"
+fi
 
 cd "../../$CATEGORY/$ROBOTPKG"