diff --git a/lib/spack/spack/cmd/diy.py b/lib/spack/spack/cmd/diy.py
index f7998720ac40354e40201f952a701aa26ba6c0c3..9f8a6d39db3c6b85cb9952959039a1cf3c81a7fc 100644
--- a/lib/spack/spack/cmd/diy.py
+++ b/lib/spack/spack/cmd/diy.py
@@ -59,7 +59,7 @@ def diy(self, args):
         tty.die("spack diy only takes one spec.")
 
     # Take a write lock before checking for existence.
-    with spack.installed_db.write_lock():
+    with spack.installed_db.write_transaction():
         spec = specs[0]
         if not spack.db.exists(spec.name):
             tty.warn("No such package: %s" % spec.name)
diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py
index ba824bd658398e21746b32c9bb9cdaf4ed8510a9..836a6260c87561006505f7cf73909569df1a4192 100644
--- a/lib/spack/spack/cmd/install.py
+++ b/lib/spack/spack/cmd/install.py
@@ -71,7 +71,7 @@ def install(parser, args):
     specs = spack.cmd.parse_specs(args.packages, concretize=True)
     for spec in specs:
         package = spack.db.get(spec)
-        with spack.installed_db.write_lock():
+        with spack.installed_db.write_transaction():
             package.do_install(
                 keep_prefix=args.keep_prefix,
                 keep_stage=args.keep_stage,
diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py
index 1dae84444ab6dd284ac263c83a9e2ffba8a81d81..e80f2d2636d0d3dbcba3f7f34a7bc565547f53a3 100644
--- a/lib/spack/spack/cmd/uninstall.py
+++ b/lib/spack/spack/cmd/uninstall.py
@@ -53,7 +53,7 @@ def uninstall(parser, args):
     if not args.packages:
         tty.die("uninstall requires at least one package argument.")
 
-    with spack.installed_db.write_lock():
+    with spack.installed_db.write_transaction():
         specs = spack.cmd.parse_specs(args.packages)
 
         # For each spec provided, make sure it refers to only one package.