diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py
index 23ec74abed528b2ed88c553f5427693420477b97..068dbec10a7f9d6dacb7868638540d501f14db79 100644
--- a/var/spack/repos/builtin/packages/dealii/package.py
+++ b/var/spack/repos/builtin/packages/dealii/package.py
@@ -245,7 +245,7 @@ def install(self, spec, prefix):
             # change Linear Algebra to Trilinos
             # The below filter_file should be different for versions
             # before and after 8.4.0
-            if spec.satisfies('@8.4.0:'):
+            if spec.satisfies('@8.4.0:') or spec.satisfies('@dev'):
                 filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)',
                             ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc')
             else:
@@ -257,7 +257,7 @@ def install(self, spec, prefix):
 
             # the rest of the tests on step 40 only works for
             # dealii version 8.4.0 and after
-            if spec.satisfies('@8.4.0:'):
+            if spec.satisfies('@8.4.0:') or spec.satisfies('@dev'):
                 print('=====================================')
                 print('=== Step-40 Trilinos SuperluDist ====')
                 print('=====================================')