diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 24da1af56463b0e60816e1b4ee2743e15d59621a..ea00e1723dfccc0d7b7237602eb58bd11dbab79e 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -1888,7 +1888,7 @@ def _mark_concrete(self, value=True):
         unless there is a need to force a spec to be concrete.
         """
         for s in self.traverse(deptype_query=all):
-            if s.concrete and s.package.installed:
+            if (not value) and s.concrete and s.package.installed:
                 continue
             s._normal = value
             s._concrete = value
diff --git a/lib/spack/spack/test/database.py b/lib/spack/spack/test/database.py
index 131730e40f588cfdc883d2b39b57b2e644989d6f..bc7354a4b4729dedd051acf50a6bb7d0f2d3f2df 100644
--- a/lib/spack/spack/test/database.py
+++ b/lib/spack/spack/test/database.py
@@ -32,6 +32,7 @@
 import pytest
 import spack
 import spack.store
+from spack.test.conftest import MockPackageMultiRepo
 from spack.util.executable import Executable
 from llnl.util.tty.colify import colify
 
@@ -380,6 +381,22 @@ def fail_while_writing():
         assert install_db.query('cmake', installed=any) == []
 
 
+def test_115_reindex_with_packages_not_in_repo(database, refresh_db_on_exit):
+    install_db = database.mock.db
+
+    saved_repo = spack.repo
+    # Dont add any package definitions to this repository, the idea is that
+    # packages should not have to be defined in the repository once they are
+    # installed
+    mock_repo = MockPackageMultiRepo([])
+    try:
+        spack.repo = mock_repo
+        spack.store.db.reindex(spack.store.layout)
+        _check_db_sanity(install_db)
+    finally:
+        spack.repo = saved_repo
+
+
 def test_external_entries_in_db(database):
     install_db = database.mock.db