diff --git a/core/modules/system/src/Controller/SystemController.php b/core/modules/system/src/Controller/SystemController.php
index 43ab34e..425fe27 100644
--- a/core/modules/system/src/Controller/SystemController.php
+++ b/core/modules/system/src/Controller/SystemController.php
@@ -249,7 +249,12 @@ public function themesPage() {
         }
         if (!empty($theme->status)) {
           if (!$theme->is_default) {
-            if ($theme->getName() != $admin_theme) {
+            $theme_uninstallable = TRUE;
+            // Check for a base theme of the default/admin theme.
+            if ($theme->getName() == $admin_theme || isset($theme->required_by[$admin_theme]) || isset($theme->required_by[$theme_default])) {
+              $theme_uninstallable = FALSE;
+            }
+            if ($theme_uninstallable) {
               $theme->operations[] = array(
                 'title' => $this->t('Uninstall'),
                 'route_name' => 'system.theme_uninstall',
diff --git a/core/modules/system/src/Tests/System/ThemeTest.php b/core/modules/system/src/Tests/System/ThemeTest.php
index e1b091d..a4c18cd 100644
--- a/core/modules/system/src/Tests/System/ThemeTest.php
+++ b/core/modules/system/src/Tests/System/ThemeTest.php
@@ -188,6 +188,10 @@ function testAdministrationTheme() {
     );
     $this->drupalPostForm('admin/appearance', $edit, t('Save configuration'));
 
+    // Check that the classy theme cannot be installed as it is a base theme of bartik.
+    $this->drupalGet('admin/appearance');
+    $this->assertNoRaw('Uninstall Classy theme', 'A link to uninstall the classy theme does not appear on the theme settings page.');
+
     $this->drupalGet('admin/config');
     $this->assertRaw('core/themes/seven', 'Administration theme used on an administration page.');
 
