Ubuntu 20.04 启动速度因某些服务而变慢

Ubuntu 20.04 启动速度因某些服务而变慢

我在用着Ubuntu 20.04 LTS. 开机时间为增加急剧下降。我该如何减少启动时间?哪些服务可以停止

以下是输出systemd-analyze blame

2min 1.371s connman-wait-online.service                          
1min 29.696s nmbd.service                                         
     39.727s mysql.service                                        
     34.196s udisks2.service                                      
     30.499s man-db.service                                       
     30.076s systemd-journal-flush.service                        
     28.287s [email protected]                           
     25.887s plymouth-quit-wait.service                           
     23.571s networkd-dispatcher.service                          
     23.567s snapd.service                                        
     22.759s logrotate.service                                    
     20.528s NetworkManager-wait-online.service                   
     19.988s [email protected]                                  
     19.236s dev-sda5.device                                      
     13.308s accounts-daemon.service                              
     12.483s apache2.service                                      
     11.346s polkit.service                                       
     10.809s dev-loop21.device                                    
     10.805s avahi-daemon.service                                 
     10.802s bluetooth.service                                    
     10.792s NetworkManager.service                               
     10.779s connman.service                                      
     10.769s dundee.service                                       
     10.762s ofono.service                                        
     10.731s dev-loop11.device                                    
     10.664s dev-loop23.device                                    
     10.611s dev-loop18.device                                    
     10.510s dev-loop17.device                                    
     10.501s dev-loop28.device                                    
     10.415s switcheroo-control.service                           
     10.410s thermald.service                                     
     10.394s wpa_supplicant.service                               
     10.386s systemd-logind.service                               
     10.371s dev-loop27.device                                    
     10.217s dev-loop19.device                                    
     10.139s vboxdrv.service                                      
      9.931s dev-loop25.device                                    
      9.865s dev-loop26.device                                    
      9.703s dev-loop8.device                                     
      9.581s dev-loop20.device                                    
      9.229s dev-loop22.device                                    
      9.060s dev-loop16.device                                    
      8.922s dev-loop9.device                                     
      8.919s dev-loop15.device                                    
      8.888s dev-loop24.device                                    
      8.305s dev-loop10.device                                    
      8.210s dev-loop7.device                                     
      8.014s ModemManager.service                                 
      7.848s dev-loop12.device                                    
      7.073s dev-loop0.device                                     
      6.946s dev-loop3.device                                     
      6.837s dev-loop1.device                                     
      6.834s dev-loop14.device                                    
      6.497s redis-server.service                                 
      6.457s dev-loop5.device                                     
      6.321s dev-loop2.device                                     
      6.296s systemd-resolved.service                             
      6.218s dev-loop13.device                                    
      6.124s gpu-manager.service                                  
      6.052s dev-loop6.device                                     
      5.453s dev-loop4.device                                     
      4.993s fwupd.service                                        
      4.530s rsyslog.service                                      
      3.600s apt-daily-upgrade.service                            
      3.543s grub-common.service                                  
      3.462s apport.service                                       
      3.450s systemd-fsck@dev-disk-by\x2duuid-18B7\x2d5624.service
      3.000s plymouth-read-write.service                          
      2.986s e2scrub_reap.service                                 
      2.882s grub-initrd-fallback.service                         
      2.421s systemd-udevd.service                                
      2.234s snap-canonical\x2dlivepatch-95.mount                 
      2.120s snap-chromium-1373.mount                             
      2.032s snap-chromium-1382.mount                             
      2.023s snap-core-10126.mount                                
      2.004s snap-core-10185.mount                                
      1.914s ssh.service                                          
      1.895s apparmor.service                                     
      1.769s snap-core18-1885.mount                               
      1.656s snap-core18-1932.mount                               
      1.627s snapd.seeded.service                                 
      1.611s snap-gnome\x2d3\x2d26\x2d1604-100.mount              
      1.610s snap-gnome\x2d3\x2d26\x2d1604-98.mount               
      1.492s snap-gnome\x2d3\x2d28\x2d1804-128.mount              
      1.488s networking.service                                   
      1.448s snap-gnome\x2d3\x2d28\x2d1804-145.mount              
      1.409s snap-gnome\x2d3\x2d34\x2d1804-36.mount               
      1.320s snap-gnome\x2d3\x2d34\x2d1804-60.mount               
      1.298s snap-gnome\x2dsystem\x2dmonitor-145.mount            
      1.297s snap-gnome\x2dsystem\x2dmonitor-148.mount            
      1.267s snapd.apparmor.service                               
      1.219s systemd-tmpfiles-setup.service                       
      1.198s snap-gtk\x2dcommon\x2dthemes-1502.mount              
      1.196s snap-gtk\x2dcommon\x2dthemes-1506.mount              
      1.091s snap-heroku-3997.mount                               
      1.090s snap-heroku-3999.mount                               
      1.010s sysstat.service                                      
      1.008s xl2tpd.service                                       
       978ms systemd-sysusers.service                             
       970ms systemd-modules-load.service                         
       899ms systemd-random-seed.service                          
       897ms smbd.service                                         
       830ms gdm.service                                          
       730ms snap-insomnia-105.mount                              
       703ms tlp.service                                          
       673ms [email protected]                                 
       649ms snap-insomnia-109.mount                              
       594ms systemd-backlight@leds:asus::kbd_backlight.service   
       588ms snap-qt551-30.mount                                  
       584ms systemd-udev-trigger.service                         
       534ms systemd-journald.service                             
       490ms snap-pycharm\x2dcommunity-214.mount                  
       483ms upower.service                                       
       476ms keyboard-setup.service                               
       465ms snap-pycharm\x2dcommunity-211.mount                  
       463ms plymouth-start.service                               
       463ms systemd-backlight@backlight:intel_backlight.service  
       440ms systemd-sysctl.service                               
       421ms swapfile.swap                                        
       417ms [email protected]                               
       405ms dns-clean.service                                    
       384ms systemd-tmpfiles-setup-dev.service                   
       358ms snap-vlc-1620.mount                                  
       341ms pppd-dns.service                                     
       339ms binfmt-support.service                               
       331ms snap-scrcpy-254.mount                                
       324ms snap-scrcpy-243.mount                                
       296ms snap-qt551-29.mount                                  
       253ms ifupdown-pre.service                                 
       250ms snap-vlc-1700.mount                                  
       234ms systemd-timesyncd.service                            
       224ms alsa-restore.service                                 
       205ms rtkit-daemon.service                                 
       203ms colord.service                                       
       198ms apport-autoreport.service                            
       195ms openvpn.service                                      
       189ms [email protected]                                    
       170ms console-setup.service                                
       144ms systemd-remount-fs.service                           
       144ms tor.service                                          
       131ms kerneloops.service                                   
       127ms blueman-mechanism.service                            
       126ms ufw.service                                          
       116ms kmod-static-nodes.service                            
       116ms systemd-update-utmp.service                          
       109ms boot-efi.mount                                       
        87ms vboxballoonctrl-service.service                      
        86ms vboxautostart-service.service                        
        59ms setvtrgb.service                                     
        59ms systemd-user-sessions.service                        
        56ms dev-hugepages.mount                                  
        55ms dev-mqueue.mount                                     
        54ms sys-kernel-debug.mount                               
        54ms sys-kernel-tracing.mount                             
        41ms vboxweb-service.service                              
        39ms [email protected]                        
        37ms proc-sys-fs-binfmt_misc.mount                        
        28ms packagekit.service                                   
        18ms systemd-tmpfiles-clean.service                       
        16ms systemd-update-utmp-runlevel.service                 
         3ms sys-fs-fuse-connections.mount                        
         2ms sys-kernel-config.mount                              
         1ms postgresql.service                                   
       759us snapd.socket   

更新: 删除 snap 并禁用不需要的服务后,这是更新后的输出:

1min 18.932s apport-autoreport.service                            
     18.404s udisks2.service                                      
     13.156s networkd-dispatcher.service                          
     10.534s accounts-daemon.service                              
      9.833s [email protected]                                  
      7.489s polkit.service                                       
      7.049s switcheroo-control.service                           
      6.946s avahi-daemon.service                                 
      6.939s NetworkManager.service                               
      6.929s connman.service                                      
      6.917s dundee.service                                       
      6.869s ofono.service                                        
      6.774s ModemManager.service                                 
      6.652s thermald.service                                     
      6.652s systemd-logind.service                               
      6.630s wpa_supplicant.service                               
      6.538s dev-sda5.device                                      
      6.221s vboxdrv.service                                      
      4.375s grub-initrd-fallback.service                         
      4.188s gpu-manager.service                                  
      3.881s ssh.service                                          
      3.861s grub-common.service                                  
      3.456s xl2tpd.service   

相关内容