diff --git a/includes/update.inc b/includes/update.inc
index 1eb7a1d..161edaa 100644
--- a/includes/update.inc
+++ b/includes/update.inc
@@ -748,6 +748,25 @@ function update_fix_d7_requirements() {
     // Rename action description to label.
     db_change_field('actions', 'description', 'label', array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '0'));
 
+    // Remove records of contributed modules that have been moved into core,
+    // since their existence would invoke module updates intended to be run in a
+    // D7 environment before the D7 version has been installed.
+    db_delete('system')
+      ->condition(db_or()
+        // Field type modules.
+        ->condition('name', 'text')
+        ->condition('name', 'number')
+        ->condition('name', 'image')
+        // Other modules.
+        ->condition('name', 'contextual')
+        ->condition('name', 'dashboard')
+        ->condition('name', 'rdf')
+        ->condition('name', 'shortcut')
+        ->condition('name', 'simpletest')
+        ->condition('name', 'toolbar')
+      )
+      ->execute();
+
     variable_set('update_d7_requirements', TRUE);
   }
 
diff --git a/modules/simpletest/tests/upgrade/drupal-6.filled.database.php b/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
index a916281..fe5881c 100644
--- a/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
+++ b/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
@@ -12146,6 +12146,18 @@ db_insert('system')->fields(array(
   'info' => 'a:8:{s:4:"name";s:8:"Taxonomy";s:11:"description";s:38:"Enables the categorization of content.";s:7:"package";s:15:"Core - optional";s:7:"version";s:8:"6.20-dev";s:4:"core";s:3:"6.x";s:12:"dependencies";a:0:{}s:10:"dependents";a:0:{}s:3:"php";s:5:"4.3.5";}',
 ))
 ->values(array(
+  'filename' => 'sites/all/modules/cck/modules/text/text.module',
+  'name' => 'text',
+  'type' => 'module',
+  'owner' => '',
+  'status' => '1',
+  'throttle' => '0',
+  'bootstrap' => '0',
+  'schema_version' => '0',
+  'weight' => '0',
+  'info' => 'a:8:{s:4:"name";s:4:"Text";s:11:"description";s:32:"Defines simple text field types.";s:7:"package";s:3:"CCK";s:7:"version";s:11:"6.x-2.x-dev";s:4:"core";s:3:"6.x";s:12:"dependencies";a:1:{i:0;s:7:"content";}s:10:"dependents";a:0:{}s:3:"php";s:5:"4.3.5";}',
+))
+->values(array(
   'filename' => 'modules/throttle/throttle.module',
   'name' => 'throttle',
   'type' => 'module',
