diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 61b2650ad0..a05d63eaf9 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -40,6 +40,13 @@ function system_requirements($phase) {
     $profile = drupal_get_profile();
     if ($profile != 'standard') {
       $info = system_get_info('module', $profile);
+
+      // If the profile isn't installed properly then install it.
+      if (empty($info)) {
+        \Drupal::service('module_installer')->install(array($profile), FALSE);
+        $info = system_get_info('module', $profile);
+      }
+      
       $requirements['install_profile'] = [
         'title' => t('Installation profile'),
         'value' => t('%profile_name (%profile-%version)', [
