diff --git a/core/modules/user/src/Entity/Role.php b/core/modules/user/src/Entity/Role.php
index 18194f3390..7afe4e6516 100644
--- a/core/modules/user/src/Entity/Role.php
+++ b/core/modules/user/src/Entity/Role.php
@@ -4,6 +4,7 @@
 
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Installer\InstallerKernel;
 use Drupal\user\RoleInterface;
 
 /**
@@ -204,7 +205,13 @@ public function calculateDependencies() {
     $valid_permissions = array_intersect($this->permissions, array_keys($permission_definitions));
     $invalid_permissions = array_diff($this->permissions, $valid_permissions);
     if (!empty($invalid_permissions)) {
-      throw new \RuntimeException('Adding non-existent permissions to a role is not allowed. The incorrect permissions are "' . implode('", "', $invalid_permissions) . '".');
+      if (!InstallerKernel::installationAttempted()) {
+        // Ignore non-existent permissions during initial site installations.
+        // Some permissions are declared dynamically through
+        // 'permission_callbacks', e.g. config entities. And will fail if
+        // they're defined by a distribution.
+        throw new \RuntimeException('Adding non-existent permissions to a role is not allowed. The incorrect permissions are "' . implode('", "', $invalid_permissions) . '".');
+      }
     }
     foreach ($valid_permissions as $permission) {
       // Depend on the module that is providing this permissions.
