diff --git a/tools/read-dependencies b/tools/read-dependencies
index 421f470a..217e5cf1 100755
--- a/tools/read-dependencies
+++ b/tools/read-dependencies
@@ -238,9 +238,11 @@ def main(distro):
def pkg_install(pkg_list, distro, test_distro=False, dry_run=False):
"""Install a list of packages using the DISTRO_INSTALL_PKG_CMD."""
if test_distro:
- pkg_list = list(pkg_list) + CI_SYSTEM_BASE_PKGS['common']
- distro_base_pkgs = CI_SYSTEM_BASE_PKGS.get(distro, [])
- pkg_list += distro_base_pkgs
+ ci_pkgs = [p for p in
+ CI_SYSTEM_BASE_PKGS['common'] +
+ CI_SYSTEM_BASE_PKGS.get(distro, [])
+ if p not in pkg_list]
+ pkg_list = list(pkg_list) + ci_pkgs
print('Installing deps: {0}{1}'.format(
'(dryrun)' if dry_run else '', ' '.join(pkg_list)))
install_cmd = []