![Kubuntu 启动速度极慢(18.04 LTS)](https://linux22.com/image/1168648/Kubuntu%20%E5%90%AF%E5%8A%A8%E9%80%9F%E5%BA%A6%E6%9E%81%E6%85%A2%EF%BC%8818.04%20LTS%EF%BC%89.png)
我的 Kubuntu 18.04 (LTS) 启动大约需要 3 分钟。它目前大约有 6 个月的历史了。
相关详情如下:
uname -a
Linux konsole 5.0.0-31-generic #33~18.04.1-Ubuntu SMP Tue Oct 1 10:20:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
systemd-analyze
Startup finished in 5.754s (kernel) + 46.078s (userspace) = 51.833s
graphical.target reached after 46.059s in userspace
(选取前几名)
systemd-analyze blame
15.969s systemd-journal-flush.service
13.596s NetworkManager-wait-online.service
13.000s networkd-dispatcher.service
12.798s dev-sda1.device
8.445s gpu-manager.service
7.320s udisks2.service
6.598s ssh.service
5.433s NetworkManager.service
5.351s ModemManager.service
4.917s systemd-udevd.service
4.525s vboxdrv.service
4.520s apparmor.service
4.164s grub-common.service
3.576s accounts-daemon.service
3.110s thermald.service
3.109s bluetooth.service
3.107s lm-sensors.service
2.491s wpa_supplicant.service
2.335s systemd-tmpfiles-setup.service
1.901s systemd-rfkill.service
1.862s systemd-logind.service
1.709s systemd-fsck@dev-disk-by\x2duuid-199d5cb3\x2d2d16\x2d4f3f\x2d8af8\x2d99c53ad33b9f.service
1.634s avahi-daemon.service
1.441s systemd-backlight@backlight:intel_backlight.service
1.286s packagekit.service
1.271s systemd-tmpfiles-setup-dev.service
1.168s systemd-modules-load.service
1.157s binfmt-support.service
1.045s keyboard-setup.service
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 @30.321s
└─multi-user.target @30.321s
└─networkd-dispatcher.service @20.286s +10.034s
└─basic.target @17.615s
└─sockets.target @17.615s
└─avahi-daemon.socket @17.615s
└─sysinit.target @17.523s
└─apparmor.service @14.592s +2.930s
└─local-fs.target @14.590s
└─home.mount @14.347s +242ms
└─systemd-fsck@dev-disk-by\x2duuid-199d5cb3\x2d2d16\x2d4f3f\x2d8af8\x2d99c53ad33b9f.service @12.804s +1.478s
└─dev-disk-by\x2duuid-199d5cb3\x2d2d16\x2d4f3f\x2d8af8\x2d99c53ad33b9f.device @12.803s
答案1
可以禁用一些服务以减少启动时间,而不会影响桌面环境功能在大多数情况下:
首先:
后缀出现在您的帖子中。如果您的机器不是邮件服务器,并且您不使用 POSTFIX,您可以postfix.service
通过在终端中运行以下命令来禁用它:
sudo systemctl disable postfix.service
或者您可以通过在终端中运行以下命令来完全卸载 POSTFIX:
sudo apt remove postfix
第二:
NetworkManager-wait-online.service
可以通过在终端中运行以下命令来禁用:
sudo systemctl disable NetworkManager-wait-online.service
请参阅这个答案了解更多解释。
第三:
两项服务依赖于的功能NetworkManager-wait-online.service
是networkd-dispatcher.service
和systemd-networkd.service
。也可以通过在终端中运行以下命令来禁用它们:
sudo systemctl disable networkd-dispatcher.service
和:
sudo systemctl disable systemd-networkd.service
这两项服务严格用于systemd的连接目的,并且不会影响登录后桌面环境的连接。