diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index e477a4685d..9031ed1f6d 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -1854,9 +1854,6 @@ function install_finish_translations(&$install_state) {
 function install_finished(&$install_state) {
   $profile = $install_state['parameters']['profile'];
 
-  // Installation profiles are always loaded last.
-  module_set_weight($profile, 1000);
-
   // Build the router once after installing all modules.
   // This would normally happen upon KernelEvents::TERMINATE, but since the
   // installer does not use an HttpKernel, that event is never triggered.
diff --git a/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php
index 7e53d711d5..dd714d8c62 100644
--- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php
+++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php
@@ -218,6 +218,14 @@ public function install(array $module_list, $enable_dependencies = TRUE) {
         $current_module_filenames = $this->moduleHandler->getModuleList();
         $current_modules = array_fill_keys(array_keys($current_module_filenames), 0);
         $current_modules = module_config_sort(array_merge($current_modules, $extension_config->get('module')));
+        // Move the profile to end.
+        $profile = $extension_config->get('profile');
+        if (isset($current_modules[$profile])) {
+          unset($current_modules[$profile]);
+          // When module weight no longer exists the entire list should be
+          // dependency ordered.
+          $current_modules[$profile] = 1000;
+        }
         $module_filenames = [];
         foreach ($current_modules as $name => $weight) {
           if (isset($current_module_filenames[$name])) {
diff --git a/core/modules/content_translation/content_translation.install b/core/modules/content_translation/content_translation.install
index ba67d2141e..cbd9be18d9 100644
--- a/core/modules/content_translation/content_translation.install
+++ b/core/modules/content_translation/content_translation.install
@@ -12,16 +12,6 @@
  * Implements hook_install().
  */
 function content_translation_install() {
-  // Assign a fairly low weight to ensure our implementation of
-  // hook_module_implements_alter() is run among the last ones.
-  module_set_weight('content_translation', 10);
-
-  // Skip the guidance messages about enabling translation features if the
-  // module was installed in the Drupal installation process.
-  if (InstallerKernel::installationAttempted()) {
-    return;
-  }
-
   // Translation works when at least two languages are added.
   if (count(\Drupal::languageManager()->getLanguages()) < 2) {
     $t_args = [
diff --git a/core/modules/forum/forum.install b/core/modules/forum/forum.install
index 7b6f40f9ba..fd408fe00a 100644
--- a/core/modules/forum/forum.install
+++ b/core/modules/forum/forum.install
@@ -11,9 +11,7 @@
 /**
  * Implements hook_install().
  */
-function forum_install($is_syncing) {
-  // Set the weight of the forum.module to 1 so it is loaded after the taxonomy.module.
-  module_set_weight('forum', 1);
+function forum_install() {
   // Do not allow to delete the forum's node type machine name.
   $locked = \Drupal::state()->get('node.type.locked');
   $locked['forum'] = 'forum';
diff --git a/core/modules/menu_link_content/menu_link_content.module b/core/modules/menu_link_content/menu_link_content.module
index 057a22842f..08d345bc94 100644
--- a/core/modules/menu_link_content/menu_link_content.module
+++ b/core/modules/menu_link_content/menu_link_content.module
@@ -32,13 +32,16 @@ function menu_link_content_help($route_name, RouteMatchInterface $route_match) {
 }
 
 /**
- * Implements hook_entity_type_alter().
+ * Implements hook_module_implements_alter().
  */
-function menu_link_content_entity_type_alter(array &$entity_types) {
-  // @todo Moderation is disabled for custom menu links until when we have an UI
-  //   for them.
-  //   @see https://www.drupal.org/project/drupal/issues/2350939
-  $entity_types['menu_link_content']->setHandlerClass('moderation', '');
+function menu_link_content_module_implements_alter(&$implementations, $hook) {
+  if ($hook == 'path_update' || $hook == 'path_insert' || $hook == 'path_delete') {
+    // Move menu_link_content_path_*() implementations to the end of the list so
+    // that they occur after system_path_*().
+    $group = $implementations['menu_link_content'];
+    unset($implementations['menu_link_content']);
+    $implementations['menu_link_content'] = $group;
+  }
 }
 
 /**
diff --git a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php
index bc12889729..661807d19f 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentCacheabilityBubblingTest.php
@@ -45,10 +45,7 @@ protected function setUp(): void {
 
     $this->setUpCurrentUser(['uid' => 0]);
     $this->installEntitySchema('menu_link_content');
-
-    // Ensure that the weight of module_link_content is higher than system.
-    // @see menu_link_content_install()
-    module_set_weight('menu_link_content', 1);
+    $this->installEntitySchema('user');
   }
 
   /**
diff --git a/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php b/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php
index 00e9bf79b2..8fe6de9789 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/PathAliasMenuLinkContentTest.php
@@ -39,10 +39,6 @@ protected function setUp(): void {
     $this->installEntitySchema('user');
     $this->installEntitySchema('menu_link_content');
     $this->installEntitySchema('path_alias');
-
-    // Ensure that the weight of module_link_content is higher than system.
-    // @see menu_link_content_install()
-    module_set_weight('menu_link_content', 1);
   }
 
   /**
diff --git a/core/modules/system/tests/modules/module_handler_test_multiple/module_handler_test_multiple.install b/core/modules/system/tests/modules/module_handler_test_multiple/module_handler_test_multiple.install
index 4d992d4c38..85a5ebfaee 100644
--- a/core/modules/system/tests/modules/module_handler_test_multiple/module_handler_test_multiple.install
+++ b/core/modules/system/tests/modules/module_handler_test_multiple/module_handler_test_multiple.install
@@ -4,11 +4,3 @@
  * @file
  * Install, update and uninstall functions for the module_handler_test_multiple module.
  */
-
-/**
- * Implements hook_install().
- */
-function module_handler_test_multiple_install() {
-  // Set weight of module.
-  module_set_weight('module_handler_test_multiple', 1);
-}
diff --git a/core/modules/system/tests/modules/module_handler_test_multiple/module_handler_test_multiple_child/module_handler_test_multiple_child.install b/core/modules/system/tests/modules/module_handler_test_multiple/module_handler_test_multiple_child/module_handler_test_multiple_child.install
index c373c654d5..f656169a92 100644
--- a/core/modules/system/tests/modules/module_handler_test_multiple/module_handler_test_multiple_child/module_handler_test_multiple_child.install
+++ b/core/modules/system/tests/modules/module_handler_test_multiple/module_handler_test_multiple_child/module_handler_test_multiple_child.install
@@ -7,11 +7,3 @@
  * Install, update and uninstall functions for the
  * module_handler_test_multiple_child module.
  */
-
-/**
- * Implements hook_install().
- */
-function module_handler_test_multiple_child_install() {
-  // Set weight of module.
-  module_set_weight('module_handler_test_multiple_child', 1);
-}
diff --git a/core/modules/system/tests/modules/url_alter_test/url_alter_test.install b/core/modules/system/tests/modules/url_alter_test/url_alter_test.install
index 0237a9e27c..34cc67dda0 100644
--- a/core/modules/system/tests/modules/url_alter_test/url_alter_test.install
+++ b/core/modules/system/tests/modules/url_alter_test/url_alter_test.install
@@ -4,11 +4,3 @@
  * @file
  * Install hooks for test module.
  */
-
-/**
- * Implements hook_install().
- */
-function url_alter_test_install() {
-  // Set the weight of this module to one higher than forum.module.
-  module_set_weight('url_alter_test', 2);
-}
diff --git a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
index a6290498d0..fabc552a86 100644
--- a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
+++ b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
@@ -40,14 +40,6 @@ public function testModuleList() {
     sort($module_list);
     $this->assertModuleList($module_list, 'After adding a module');
 
-    // Try to mess with the module weights.
-    module_set_weight('ban', 20);
-
-    // Move ban to the end of the array.
-    unset($module_list[array_search('ban', $module_list)]);
-    $module_list[] = 'ban';
-    $this->assertModuleList($module_list, 'After changing weights');
-
     // Test the fixed list feature.
     $fixed_list = [
       'system' => 'core/modules/system/system.module',
diff --git a/core/modules/views/views.install b/core/modules/views/views.install
index a7ed0b99a8..fd81b26d86 100644
--- a/core/modules/views/views.install
+++ b/core/modules/views/views.install
@@ -5,12 +5,8 @@
  * Contains install and update functions for Views.
  */
 
-/**
- * Implements hook_install().
- */
-function views_install() {
-  module_set_weight('views', 10);
-}
+use Drupal\Core\Config\Schema\ArrayElement;
+use Drupal\views\Views;
 
 /**
  * Implements hook_update_last_removed().
diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php
index e268e4266c..dba1c34d91 100644
--- a/core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Extension/ModuleInstallerTest.php
@@ -49,8 +49,6 @@ public function testConfigChangeOnInstall() {
 
     $this->assertArrayHasKey('module_handler_test_multiple', $modules, 'Module module_handler_test_multiple is installed');
     $this->assertArrayHasKey('module_handler_test_multiple_child', $modules, 'Module module_handler_test_multiple_child is installed');
-    $this->assertEquals(1, $modules['module_handler_test_multiple'], 'Weight of module_handler_test_multiple is set.');
-    $this->assertEquals(1, $modules['module_handler_test_multiple_child'], 'Weight of module_handler_test_multiple_child is set.');
   }
 
   /**
