diff --git a/core/lib/Drupal/Core/Update/UpdateServiceProvider.php b/core/lib/Drupal/Core/Update/UpdateServiceProvider.php
index ad3d4df1d8..d72f9901a8 100644
--- a/core/lib/Drupal/Core/Update/UpdateServiceProvider.php
+++ b/core/lib/Drupal/Core/Update/UpdateServiceProvider.php
@@ -32,6 +32,19 @@ public function alter(ContainerBuilder $container) {
     $definition = $container->getDefinition('library.discovery.collector');
     $argument = new Reference('cache.null');
     $definition->replaceArgument(0, $argument);
+
+    // Loop over the defined services and remove all with unmet dependencies.
+    // The container can not be run with unmet dependencies so modules can not
+    // even run their update hooks to enable newly added dependencies, as the
+    // kernel in update.php can not boot.
+    foreach ($container->getDefinitions() as $key => $definition) {
+      foreach ($definition->getArguments() as $argument) {
+        if ($argument instanceof Reference && !$container->has((string) $argument)) {
+          // If the container does not have the argument, remove the service.
+          $container->removeDefinition($key);
+        }
+      }
+    }
   }
 
 }
diff --git a/core/modules/system/src/Tests/Update/UpdatePathNewDependencyTest.php b/core/modules/system/src/Tests/Update/UpdatePathNewDependencyTest.php
new file mode 100644
index 0000000000..fd61cf42c2
--- /dev/null
+++ b/core/modules/system/src/Tests/Update/UpdatePathNewDependencyTest.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Drupal\system\Tests\Update;
+
+/**
+ * @group system
+ */
+class UpdatePathNewDependencyTest extends UpdatePathTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setDatabaseDumpFiles() {
+    // No database required,
+    $this->databaseDumpFiles = [
+      __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
+    ];
+  }
+
+  /**
+   * Test that a module can add services that depend on new modules.
+   */
+  public function testUpdateNewDependency() {
+    // The new_dependency_test before the update is just a info.yml file.
+    $extension_config = \Drupal::configFactory()->getEditable('core.extension');
+    $extension_config
+      ->set('module.new_dependency_test', 0)
+      ->set('module', module_config_sort($extension_config->get('module')))
+      ->save(TRUE);
+    drupal_set_installed_schema_version('new_dependency_test', \Drupal::CORE_MINIMUM_SCHEMA_VERSION);
+
+    // Running the updates enables the dependency.
+    $this->runUpdates();
+
+    $this->assertTrue(array_key_exists('new_dependency_test', \Drupal::config('core.extension')->get('module')));
+    $this->assertTrue(array_key_exists('new_dependency_test_with_service', \Drupal::config('core.extension')->get('module')));
+
+    // Rebuild the container and test that the new service works.
+    $this->rebuildContainer();
+    $this->rebuildAll();
+    $this->drupalGet('/');
+    $this->assertEqual('Hello', \Drupal::service('new_dependency_test.dependent')->hello());
+
+  }
+
+}
diff --git a/core/modules/system/tests/modules/new_dependency_test/new_dependency_test.info.yml b/core/modules/system/tests/modules/new_dependency_test/new_dependency_test.info.yml
new file mode 100644
index 0000000000..eab08261b5
--- /dev/null
+++ b/core/modules/system/tests/modules/new_dependency_test/new_dependency_test.info.yml
@@ -0,0 +1,8 @@
+name: 'New Dependency test'
+type: module
+description: 'Support module for update testing.'
+package: Testing
+version: VERSION
+core: 8.x
+dependencies:
+  - new_dependency_test_with_service
diff --git a/core/modules/system/tests/modules/new_dependency_test/new_dependency_test.install b/core/modules/system/tests/modules/new_dependency_test/new_dependency_test.install
new file mode 100644
index 0000000000..84a77a915e
--- /dev/null
+++ b/core/modules/system/tests/modules/new_dependency_test/new_dependency_test.install
@@ -0,0 +1,9 @@
+<?php
+
+/**
+ * Enable the config_filter module.
+ */
+function new_dependency_test_update_8001() {
+  debug('Running the new_dependency_test_update_8001.');
+  \Drupal::getContainer()->get('module_installer')->install(['new_dependency_test_with_service']);
+}
diff --git a/core/modules/system/tests/modules/new_dependency_test/new_dependency_test.services.yml b/core/modules/system/tests/modules/new_dependency_test/new_dependency_test.services.yml
new file mode 100644
index 0000000000..94d089c331
--- /dev/null
+++ b/core/modules/system/tests/modules/new_dependency_test/new_dependency_test.services.yml
@@ -0,0 +1,4 @@
+services:
+  new_dependency_test.dependent:
+    class: Drupal\new_dependency_test\DependentService
+    arguments: ['@new_dependency_test_with_service.service']
diff --git a/core/modules/system/tests/modules/new_dependency_test/src/DependentService.php b/core/modules/system/tests/modules/new_dependency_test/src/DependentService.php
new file mode 100644
index 0000000000..54285d2e13
--- /dev/null
+++ b/core/modules/system/tests/modules/new_dependency_test/src/DependentService.php
@@ -0,0 +1,21 @@
+<?php
+
+namespace Drupal\new_dependency_test;
+
+use Drupal\new_dependency_test_with_service\NewService;
+
+class DependentService {
+
+  protected $service;
+
+  /**
+   * DependentService constructor.
+   */
+  public function __construct(NewService $service) {
+    $this->service = $service;
+  }
+
+  public function hello() {
+    return $this->service->hello();
+  }
+}
diff --git a/core/modules/system/tests/modules/new_dependency_test_with_service/new_dependency_test_with_service.info.yml b/core/modules/system/tests/modules/new_dependency_test_with_service/new_dependency_test_with_service.info.yml
new file mode 100644
index 0000000000..5091a7f79d
--- /dev/null
+++ b/core/modules/system/tests/modules/new_dependency_test_with_service/new_dependency_test_with_service.info.yml
@@ -0,0 +1,6 @@
+name: 'New Dependency test with service'
+type: module
+description: 'Support module for update testing.'
+package: Testing
+version: VERSION
+core: 8.x
diff --git a/core/modules/system/tests/modules/new_dependency_test_with_service/new_dependency_test_with_service.services.yml b/core/modules/system/tests/modules/new_dependency_test_with_service/new_dependency_test_with_service.services.yml
new file mode 100644
index 0000000000..26ba284e29
--- /dev/null
+++ b/core/modules/system/tests/modules/new_dependency_test_with_service/new_dependency_test_with_service.services.yml
@@ -0,0 +1,3 @@
+services:
+  new_dependency_test_with_service.service:
+    class: Drupal\new_dependency_test_with_service\NewService
diff --git a/core/modules/system/tests/modules/new_dependency_test_with_service/src/NewService.php b/core/modules/system/tests/modules/new_dependency_test_with_service/src/NewService.php
new file mode 100644
index 0000000000..aa9d842464
--- /dev/null
+++ b/core/modules/system/tests/modules/new_dependency_test_with_service/src/NewService.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace Drupal\new_dependency_test_with_service;
+
+class NewService {
+
+  /**
+   * @return string
+   */
+  public function hello() {
+    return 'Hello';
+  }
+
+}
