diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 3ae46792b57d75fa1aad48d1fb3060fcd5b00dfd..b4e3537e92fa3d416414e4a6273b6f14aa089257 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -1358,8 +1358,13 @@ def try_install_from_binary_cache(self, explicit):
         binary_spec._mark_concrete()
         if binary_spec not in specs:
             return False
-        tty.msg('Installing %s from binary cache' % self.name)
         tarball = binary_distribution.download_tarball(binary_spec)
+        # see #10063 : install from source if tarball doesn't exist
+        if tarball is None:
+            tty.msg('%s exist in binary cache but with different hash' %
+                    self.name)
+            return False
+        tty.msg('Installing %s from binary cache' % self.name)
         binary_distribution.extract_tarball(
             binary_spec, tarball, allow_root=False,
             unsigned=False, force=False)