Ubuntu 20.04 中的启动过程非常慢

Ubuntu 20.04 中的启动过程非常慢

我已经将我的 Ubuntu 16.04 升级到 20.04,但不幸的是启动过程非常慢。

首先,我想分享一些基于一些老问题的输出

  • 常规系统信息

    • 产品:Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    • 内存:16 GB
    • 我正在使用双启动
  • 我已经发现这个问题并使用systemd-analyze blame命令,发现mysql花费了太多时间。我记得在升级期间16.04 > 18.04 > 20.04,第二阶段的18.04 > 20.04软件包升级导致出现问题mysql。不幸的是,我没有存储结果。后来,我使用以下命令在启动过程中systemd-analyze blame禁用了turning on mysql service

    sudo systemctl disable mysql
    
  • 此后,我的系统大约需要 1 分 20 到 30 秒才能启动

  • 但随后又花了大约 2 分 30 秒的时间启动。这里,我给出了输出systemd-analyze blame

1min 27.943s apt-daily-upgrade.service                                                
 1min 9.000s man-db.service                                                           
     42.406s plymouth-quit-wait.service                                               
     39.339s docker.service                                                           
     26.615s systemd-journal-flush.service                                            
     26.369s udisks2.service                                                          
     24.319s logrotate.service                                                        
     23.836s networkd-dispatcher.service                                              
     23.460s [email protected]                                               
     22.489s snapd.service                                                            
     21.801s [email protected]                                               
     20.363s [email protected]                                              
     20.210s accounts-daemon.service                                                  
     18.149s NetworkManager-wait-online.service                                       
     18.039s ifupdown-pre.service                                                     
     16.588s polkit.service                                                           
     15.185s dev-sda10.device                                                         
     14.936s avahi-daemon.service                                                     
     14.934s bluetooth.service                                                        
     14.877s NetworkManager.service                                                   
     14.363s switcheroo-control.service                                               
     14.352s wpa_supplicant.service                                                   
     14.292s thermald.service                                                         
     14.290s systemd-logind.service                                                   
     10.461s teamviewerd.service                                                      
      7.903s dev-loop3.device                                                         
      7.799s dev-loop6.device                                                         
      7.717s dev-loop10.device                                                        
      7.657s dev-loop11.device                                                        
      7.343s dev-loop12.device                                                        
      7.324s dev-loop7.device                                                         
      7.304s dev-loop13.device                                                        
      6.389s dev-loop4.device                                                         
      6.280s ModemManager.service                                                     
      6.217s dev-loop2.device                                                         
      5.985s dev-loop8.device                                                         
      5.659s dev-loop5.device                                                         
      5.618s dev-loop9.device                                                         
      5.512s dev-loop0.device                                                         
      5.123s dev-loop1.device                                                         
      4.993s xrdp.service                                                             
      4.720s gpu-manager.service                                                      
      4.377s ssh.service                                                              
      3.217s chrome-remote-desktop.service                                            
      3.151s upower.service                                                           
      3.048s apport.service                                                           
      2.940s colord.service                                                           
      2.848s systemd-udevd.service                                                    
      2.818s systemd-fsck@dev-disk-by\x2duuid-D48A\x2d7986.service                    
      2.643s rsyslog.service                                                          
      2.195s apparmor.service                                                         
      2.158s xrdp-sesman.service                                                      
      1.698s rc.local.service                                                         
      1.651s systemd-tmpfiles-setup.service                                           
      1.490s lm-sensors.service                                                       
      1.478s resolvconf-pull-resolved.service                                         
      1.467s containerd.service                                                       
      1.438s systemd-resolved.service                                                 
      1.437s gdm.service                                                              
      1.398s plymouth-start.service                                                   
      1.375s systemd-random-seed.service                                              
      1.354s snapd.seeded.service                                                     
      1.242s systemd-tmpfiles-setup-dev.service                                       
      1.099s systemd-modules-load.service                                             
      1.060s snap-heroku-4078.mount                                                   
      1.051s sysstat.service                                                          
      1.039s systemd-backlight@backlight:intel_backlight.service                      
      1.033s snap-core-11993.mount                                                    
      1.006s tlp.service                                                              
       969ms snap-pycharm\x2dcommunity-265.mount                                      
       941ms networking.service                                                       
       924ms binfmt-support.service                                                   
       851ms snap-core18-2253.mount                                                   
       796ms snapd.apparmor.service                                                   
       725ms snap-htop-3335.mount                                                     
       702ms snap-core-12603.mount                                                    
       674ms snap-core20-1270.mount                                                   
       658ms systemd-sysctl.service                                                   
       638ms e2scrub_reap.service                                                     
       553ms snap-core18-2284.mount                                                   
       549ms systemd-sysusers.service                                                 
       535ms snap-mathpix\x2dsnipping\x2dtool-192.mount                               
       524ms [email protected]                                                     
       512ms snap-heroku-4076.mount                                                   
       486ms systemd-udev-trigger.service                                             
       478ms snap-mathpix\x2dsnipping\x2dtool-195.mount                               
       455ms snap-core20-1242.mount                                                   
       420ms snap-pycharm\x2dcommunity-261.mount                                      
       391ms systemd-timesyncd.service                                                
       371ms systemd-journald.service                                                 
       356ms snap-htop-3354.mount                                                     
       351ms dev-disk-by\x2duuid-dce0a160\x2d2ad8\x2d4826\x2d8ee8\x2d39c86b0a72da.swap
       315ms dns-clean.service                                                        
       312ms keyboard-setup.service                                                   
       307ms kerneloops.service                                                       
       249ms plymouth-read-write.service                                              
       227ms alsa-restore.service                                                     
       220ms [email protected]                                                        
       212ms ufw.service                                                              
       199ms openvpn.service                                                          
       173ms dev-hugepages.mount                                                      
       172ms dev-mqueue.mount                                                         
       171ms kmod-static-nodes.service                                                
       171ms sys-kernel-debug.mount                                                   
       170ms systemd-remount-fs.service                                               
       170ms sys-kernel-tracing.mount                                                 
       156ms grub-initrd-fallback.service                                             
       129ms hddtemp.service                                                          
       113ms finalrd.service                                                          
       111ms grub-common.service                                                      
       104ms console-setup.service                                                    
       100ms pppd-dns.service                                                         
        81ms boot-efi.mount                                                           
        62ms systemd-update-utmp.service                                              
        52ms rc-local.service                                                         
        43ms motd-news.service                                                        
        43ms systemd-user-sessions.service                                            
        24ms rtkit-daemon.service                                                     
        22ms [email protected]                                            
        21ms setvtrgb.service                                                         
        17ms systemd-update-utmp-runlevel.service                                     
        16ms systemd-tmpfiles-clean.service                                           
        12ms proc-sys-fs-binfmt_misc.mount                                            
        10ms ureadahead-stop.service                                                  
         3ms sys-fs-fuse-connections.mount                                            
         3ms postgresql.service                                                       
         2ms sys-kernel-config.mount                                                  
         2ms docker.socket                                                            
         1ms snapd.socket                                                             
  • 从输出可以看出
    1min 27.943s apt-daily-upgrade.service                                                
    1min 9.000s man-db.service
    
    它们花费了太多时间。但是,禁用服务后这些问题就不存在了mysql。有没有永久的解决方案来阻止所有奇怪的东西以加快启动过程?此外,我不想进行全新安装。

相关内容