慢的启动和登录时间Ubuntu 16.04


18

Ubuntu 16.04 64位从“登录”屏幕到桌面大约需要20秒,从grub到登录屏幕大约需要20秒,

告诉我可以安全禁用的服务,我不经常使用virtualbox和bluetooth,其他所有东西都被使用,例如打印机,wifi等
systemd-analyze

Startup finished in 5.145s (kernel) + 14.138s (userspace) = 19.284s

和输出

systemd-analyze blame


 5.837s accounts-daemon.service
          5.444s dev-sda6.device
          4.864s grub-common.service
          4.105s lightdm.service
          4.075s ModemManager.service
          4.001s preload.service
          3.844s apparmor.service
          3.566s networking.service
          3.468s apport.service
          3.332s ondemand.service
          3.272s rsyslog.service
          3.269s systemd-logind.service
          3.253s alsa-restore.service
          3.241s gpu-manager.service
          3.226s avahi-daemon.service
          3.185s systemd-user-sessions.service
          3.185s pppd-dns.service
          2.508s NetworkManager.service
          2.003s user@1000.service
          1.640s plymouth-quit-wait.service
          1.245s colord.service
           712ms systemd-update-utmp.service
           687ms systemd-udevd.service
           669ms udisks2.service
           632ms polkitd.service
           602ms brltty.service
           572ms systemd-localed.service
           567ms systemd-backlight@backlight:intel_backlight.service
           543ms systemd-rfkill.service
           527ms systemd-tmpfiles-setup-dev.service
           519ms thermald.service
           490ms systemd-tmpfiles-setup.service
           464ms systemd-modules-load.service
           454ms systemd-tmpfiles-clean.service
           450ms systemd-timesyncd.service
           428ms systemd-journald.service
           371ms wpa_supplicant.service
           340ms ufw.service
           317ms systemd-random-seed.service
           284ms console-setup.service
           281ms plymouth-start.service
           270ms dev-hugepages.mount
           270ms sys-kernel-debug.mount
           224ms systemd-udev-trigger.service
           177ms dev-mqueue.mount
           168ms plymouth-read-write.service
           165ms upower.service
           131ms dns-clean.service
           103ms systemd-sysctl.service
           102ms dev-disk-by\x2duuid-8bd6db03\x2da87b\x2d4614\x2d927a\x2dd5916f3
            68ms systemd-hostnamed.service
            49ms systemd-journal-flush.service
            47ms kmod-static-nodes.service
            47ms snapd.socket
            32ms systemd-remount-fs.service
            28ms rc-local.service
            10ms resolvconf.service
            10ms rtkit-daemon.service
             9ms systemd-update-utmp-runlevel.service
             6ms ureadahead-stop.service
             4ms sys-fs-fuse-connections.mount lines 39-61/61 (END)

以及:

systemd-analyze critical-chain

the time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @14.124s
└─lightdm.service @10.018s +4.105s
  └─systemd-user-sessions.service @6.731s +3.185s
    └─basic.target @6.625s
      └─sockets.target @6.625s
        └─snapd.socket @6.576s +47ms
          └─sysinit.target @6.574s
            └─swap.target @6.574s
              └─dev-disk-by\x2duuid-8bd6db03\x2da87b\x2d4614\x2d927a\x2dd5916f3c
                └─dev-disk-by\x2duuid-8bd6db03\x2da87b\x2d4614\x2d927a\x2dd5916f
lines 1-13/13 (END)

我正在使用7200 RPM的硬盘,我认为启动时间还可以,但是登录屏幕后,我必须经过20秒的黑屏,我已经禁用了一些启动项,例如ORCA,BLUETOOTH,备份监视器,可访问性等,个人文件共享和用户文件夹更新等,仍然没有任何改善,如何诊断和处理问题的元凶。


1
如果要分析和部分了解启动过程,我喜欢“启动图”。
dufte

1
我也安装了bootchart,但是由于某种原因,我总是如何从中创建svg,因此它总是抛出此错误路径'/var/log/bootchart.tgz'不存在,忽略了。解析错误:空状态:“ / var
log / bootchart.tgz

1
我不知道您ModemManager是否需要花费5秒钟,preload花费4秒钟或更长时间,NetworkManager花费2.5秒钟和apport4秒钟(如果禁用它们)将节省10秒钟以上的时间。
Mohamed Slama

3
systemd中包含一个引导图功能。只需运行systemd-analyze plot > bootchart.svg即可创建图形化的引导图映像并将其保存到文件中bootchart.svg。只需使用您喜欢的图像查看器打开它即可。
字节指挥官

2
这个相关的问题有一个很好的公认答案:askubuntu.com/questions/762932/…–
Katu,

Answers:


5

尝试删除一些未使用的依赖项和孤立包。这会有所帮助。
就我而言,它奏效了。跑:

sudo apt autoremove && sudo apt autoclean

另外,您可以安装Gtkorphansudo apt-get install gtkorphan)删除其他应用程序留下的所有孤立软件包和依赖项。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.