Ubuntu 20.04 的启动时间超过 4 分钟。如何减少?

Ubuntu 20.04 的启动时间超过 4 分钟。如何减少?

我的台式电脑的启动时间超过 4 分钟。我想知道应该终止哪些进程和服务才能解决这个问题。

我已经尝试修复启动应用程序,但是由于问题在于启动时间,所​​以它没有任何帮助。

系统详细信息:

OS: Ubuntu 20.04 LTS, upgraded from 19.10
Processor: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz,
RAM: 8GB DDR4
GPU: Nvidia GeForce 940MX
Hard Drive: 1TB, Seagate

输出自systemd-analyze blame

anubhav@anubhav-ubuntu:~$ sudo systemd-analyze blame
[sudo] password for anubhav: 
46.599s plymouth-quit-wait.service                           
17.140s snapd.service                                        
16.674s networkd-dispatcher.service                          
16.645s dev-sda2.device                                      
16.136s NetworkManager-wait-online.service                   
15.605s udisks2.service                                      
12.050s systemd-journal-flush.service                        
11.381s dev-loop10.device                                    
11.374s dev-loop4.device                                     
11.317s accounts-daemon.service                              
10.951s dev-loop15.device                                    
10.908s [email protected]                                     
10.419s dev-loop17.device                                    
10.371s dev-loop19.device                                    
10.363s dev-loop16.device                                    
10.315s dev-loop14.device                                    
10.260s dev-loop18.device                                    
 9.566s dev-loop11.device                                    
 9.499s dev-loop3.device                                     
 9.197s dev-loop1.device                                     
 9.162s NetworkManager.service                               
 9.086s polkit.service                                       
 8.961s dev-loop5.device                                     
 8.906s dev-loop12.device                                    
 8.871s dev-loop8.device                                     
 8.676s dev-loop7.device                                     
 8.561s dev-loop13.device                                    
 8.472s avahi-daemon.service                                 
 8.459s bluetooth.service                                    
 8.446s dev-loop2.device                                     
 8.317s switcheroo-control.service                           
 8.309s thermald.service                                     
 8.291s systemd-logind.service                               
 8.287s wpa_supplicant.service                               
 7.903s dev-loop0.device                                     
 7.448s dev-loop6.device                                     
 6.816s gpu-manager.service                                  
 6.658s dev-loop9.device                                     
 6.284s preload.service                                      
 6.121s vboxdrv.service                                      
 5.464s grub-common.service                                  
 5.174s apport.service                                       
 5.115s apport-autoreport.service                            
 5.099s ModemManager.service                                 
 4.516s dhcpcd.service                                       
 4.478s systemd-resolved.service                             
 4.475s secureboot-db.service                                
 4.457s grub-initrd-fallback.service                         
 4.293s systemd-udevd.service                                
 4.123s rsyslog.service                                      
 3.654s systemd-tmpfiles-setup.service                       
 3.351s lpd.service                                          
 2.666s gdm.service                                          
 1.954s apparmor.service                                     
 1.821s tlp.service                                          
 1.723s e2scrub_reap.service                                 
 1.522s snap-core-8689.mount                                 
 1.488s nvidia-persistenced.service                          
 1.449s systemd-modules-load.service                         
 1.440s snap-core18-1754.mount                               
 1.424s snap-pycharm\x2dprofessional-196.mount               
 1.409s snap-core18-1705.mount                               
 1.379s systemd-backlight@backlight:intel_backlight.service  
 1.338s upower.service                                       
 1.266s snap-gtk\x2dcommon\x2dthemes-1440.mount              
 1.150s plymouth-start.service                               
 1.148s systemd-random-seed.service                          
 1.064s systemd-sysctl.service                               
 1.023s systemd-tmpfiles-setup-dev.service                   
 1.012s snap-clion-111.mount                                 
  967ms systemd-journald.service                             
  965ms kerneloops.service                                   
  957ms [email protected]                                 
  950ms snap-vlc-1397.mount                                  
  939ms snapd.seeded.service                                 
  907ms snapd.apparmor.service                               
  872ms swapfile.swap                                        
  827ms systemd-timesyncd.service                            
  755ms snap-gtk\x2dcommon\x2dthemes-1506.mount              
  748ms snap-scrcpy-211.mount                                
  733ms binfmt-support.service                               
  702ms snap-scrcpy-217.mount                                
  645ms snap-goland-87.mount                                 
  624ms snap-vlc-1620.mount                                  
  561ms colord.service                                       
  470ms systemd-remount-fs.service                           
  420ms openvpn.service                                      
  392ms systemd-sysusers.service                             
  388ms setvtrgb.service                                     
  354ms systemd-user-sessions.service                        
  348ms vboxautostart-service.service                        
  348ms vboxballoonctrl-service.service                      
  327ms keyboard-setup.service                               
  321ms kmod-static-nodes.service                            
  321ms snap-goland-86.mount                                 
  316ms snap-pycharm\x2dprofessional-198.mount               
  310ms vboxweb-service.service                              
  305ms snap-clion-112.mount                                 
  250ms systemd-udev-trigger.service                         
  244ms snap-spotify-41.mount                                
  240ms snap-gnome\x2d3\x2d34\x2d1804-33.mount               
  229ms [email protected]                                    
  224ms systemd-fsck@dev-disk-by\x2duuid-94AE\x2dCADC.service
  218ms systemd-tmpfiles-clean.service                       
  217ms snap-gnome\x2d3\x2d34\x2d1804-27.mount               
  216ms console-setup.service                                
  182ms snap-snap\x2dstore-433.mount                         
  177ms dev-hugepages.mount                                  
  177ms dev-mqueue.mount                                     
  176ms sys-kernel-debug.mount                               
  175ms sys-kernel-tracing.mount                             
  160ms snap-core-9066.mount                                 
  140ms pppd-dns.service                                     
   88ms [email protected]                         
   80ms [email protected]                        
   79ms ufw.service                                          
   76ms systemd-update-utmp.service                          
   64ms boot-efi.mount                                       
   52ms proc-sys-fs-binfmt_misc.mount                        
   16ms rtkit-daemon.service                                 
   14ms alsa-restore.service                                 
   13ms systemd-update-utmp-runlevel.service                 
   12ms plymouth-read-write.service                          
    3ms sys-kernel-config.mount                              
    2ms sys-fs-fuse-connections.mount                        
  697us snapd.socket 

输出自systemd-analyze critical-chain graphical.target

anubhav@anubhav-ubuntu:~$ systemd-analyze critical-chain graphical.target
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.

graphical.target @1min 20.194s
└─multi-user.target @1min 20.194s
  └─kerneloops.service @51.394s +1.526s
    └─network-online.target @50.933s
      └─NetworkManager-wait-online.service @34.497s +16.433s
        └─NetworkManager.service @25.721s +8.774s
          └─dbus.service @25.718s
            └─basic.target @25.672s
              └─sockets.target @25.672s
                └─snapd.socket @25.671s +1ms
                  └─sysinit.target @25.368s
                    └─systemd-timesyncd.service @57.447s +310ms
                      └─systemd-tmpfiles-setup.service @22.090s +2.127s
                        └─local-fs.target @22.081s
                          └─run-user-124-gvfs.mount @59.648s
                            └─run-user-124.mount @44.537s
                              └─local-fs-pre.target @7.154s
                                └─systemd-tmpfiles-setup-dev.service @6.129s +1.024s
                                  └─systemd-sysusers.service @5.757s +371ms
                                    └─systemd-remount-fs.service @5.594s +115ms
                                      └─systemd-journald.socket @5.125s
                                        └─system.slice @5.057s
                                          └─-.slice @5.057s

相关内容