我的 Ubuntu 18.04 机器启动时间太长。当我运行此命令时,systemd-analyze blame
我在终端中看到以下输出:
6.595s NetworkManager-wait-online.service
4.349s [email protected]
4.216s dev-sda1.device
3.910s dev-loop23.device
3.905s dev-loop20.device
3.895s dev-loop21.device
3.882s dev-loop22.device
3.879s dev-loop16.device
3.847s dev-loop18.device
3.815s dev-loop24.device
3.784s dev-loop19.device
3.771s dev-loop15.device
3.709s dev-loop14.device
3.696s dev-loop17.device
3.331s dev-loop9.device
3.320s dev-loop6.device
3.318s dev-loop2.device
3.315s dev-loop8.device
3.315s dev-loop0.device
3.314s dev-loop1.device
3.313s dev-loop3.device
3.304s dev-loop4.device
3.283s dev-loop10.device
3.281s dev-loop13.device
3.275s dev-loop7.device
我能做什么dev-loopx.device
?
编辑1:命令的输出systemd-analyze critical-chain
是:
graphical.target @10.784s
└─multi-user.target @10.784s
└─kerneloops.service @10.690s +93ms
└─network-online.target @10.685s
└─NetworkManager-wait-online.service @4.046s +6.637s
└─NetworkManager.service @2.648s +1.396s
└─dbus.service @2.099s
└─basic.target @2.006s
└─sockets.target @2.006s
└─docker.socket @2.001s +3ms
└─sysinit.target @1.988s
└─apparmor.service @557ms +1.407s
└─local-fs.target @551ms
└─local-fs-pre.target @530ms
└─keyboard-setup.service @257ms +272ms
└─systemd-journald.socket @239ms
└─system.slice @238ms
└─-.slice @233ms
编辑2:命令:df -kh
输出是:
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 375M 1.7M 373M 1% /run
/dev/sda1 110G 20G 85G 20% /
tmpfs 1.9G 21M 1.9G 2% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/loop2 142M 142M 0 100% /snap/skype/38
/dev/loop0 87M 87M 0 100% /snap/core/4650
/dev/loop1 565M 565M 0 100% /snap/intellij-idea-ultimate/58
/dev/loop3 565M 565M 0 100% /snap/intellij-idea-ultimate/56
/dev/loop4 87M 87M 0 100% /snap/core/4830
/dev/loop5 138M 138M 0 100% /snap/skype/33
/dev/loop6 21M 21M 0 100% /snap/gnome-logs/25
/dev/loop9 3.8M 3.8M 0 100% /snap/gnome-system-monitor/51
/dev/loop7 141M 141M 0 100% /snap/gnome-3-26-1604/59
/dev/loop8 35M 35M 0 100% /snap/gtk-common-themes/319
/dev/loop10 3.8M 3.8M 0 100% /snap/gnome-system-monitor/41
/dev/loop15 87M 87M 0 100% /snap/core/4917
/dev/loop13 2.4M 2.4M 0 100% /snap/gnome-calculator/170
/dev/loop12 13M 13M 0 100% /snap/gnome-characters/101
/dev/loop14 15M 15M 0 100% /snap/gnome-logs/34
/dev/loop11 141M 141M 0 100% /snap/gnome-3-26-1604/70
/dev/loop16 2.4M 2.4M 0 100% /snap/gnome-calculator/178
/dev/loop20 3.8M 3.8M 0 100% /snap/gnome-system-monitor/45
/dev/loop17 2.4M 2.4M 0 100% /snap/gnome-calculator/180
/dev/loop19 133M 133M 0 100% /snap/skype/41
/dev/loop22 13M 13M 0 100% /snap/gnome-characters/96
/dev/loop18 565M 565M 0 100% /snap/intellij-idea-ultimate/60
/dev/loop23 140M 140M 0 100% /snap/gnome-3-26-1604/64
/dev/loop21 15M 15M 0 100% /snap/gnome-logs/37
/dev/loop24 13M 13M 0 100% /snap/gnome-characters/103
tmpfs 375M 40K 375M 1% /run/user/1000
edit3:删除后的结果Snapd 生态系统使用这个命令:
sudo apt purge snapd squashfs-tools gnome-软件-插件-snap
结果 systemd-analyze blame
是:
6.566s NetworkManager-wait-online.service
4.177s [email protected]
2.782s dev-sda1.device
1.788s udisks2.service
1.721s NetworkManager.service
1.670s accounts-daemon.service
1.549s ModemManager.service
1.410s mysql.service
1.385s networkd-dispatcher.service
913ms apparmor.service
900ms fwupd.service
898ms polkit.service
812ms setvtrgb.service
634ms systemd-rfkill.service
629ms systemd-journal-flush.service
597ms grub-common.service
589ms avahi-daemon.service
543ms systemd-logind.service
537ms wpa_supplicant.service
529ms apport.service
528ms zookeeper.service
501ms thermald.service
457ms networking.service
但启动时间大约为250秒。
问题是什么?