![由于网络服务,Ubuntu 18.04 启动非常慢](https://linux22.com/image/1160540/%E7%94%B1%E4%BA%8E%E7%BD%91%E7%BB%9C%E6%9C%8D%E5%8A%A1%EF%BC%8CUbuntu%2018.04%20%E5%90%AF%E5%8A%A8%E9%9D%9E%E5%B8%B8%E6%85%A2.png)
Ubuntu 18.04 的启动时间非常慢,这似乎是由 networking.service 引起的。有什么办法可以解决这个问题吗?
这是 systemd-analyze blame 的输出:
5min 438ms networking.service
20.649s plymouth-quit-wait.service
1.571s dev-mapper-ubuntu\x2d\x2dvg\x2droot.device
1.027s docker.service
904ms lvm2-pvscan@259:2.service
这是 systemd-analyze critical-chain 的输出:
graphical.target @5min 22.453s
└─multi-user.target @5min 22.453s
└─docker.service @5min 1.788s +1.027s
└─network-online.target @5min 1.785s
└─network.target @5min 1.783s
└─systemd-resolved.service @5min 3.061s +164ms
└─systemd-tmpfiles-setup.service @883ms +28ms
└─local-fs.target @881ms
└─run-user-1000-gvfs.mount @5min 2.712s
└─run-user-1000.mount @5min 1.907s
└─swap.target @1.746s
└─dev-mapper-ubuntu\x2d\x2dvg\x2dswap_1.swap @1.740s +5ms
└─dev-mapper-ubuntu\x2d\x2dvg\x2dswap_1.device @1.738s
这是 dmesg 的输出:
...
[ 3.688800] input: TPPS/2 Elan TrackPoint as /devices/platform/i8042/serio1/serio2/input/input7
[ 3.804424] [drm] RC6 on
[ 33.513690] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[ 33.614521] ip_tables: (C) 2000-2006 Netfilter Core Team
...
[ 35.982178] IPv6: ADDRCONF(NETDEV_UP): wlp4s0: link is not ready
[ 39.390128] wlp4s0: authenticate with xx:xx:xx:xx:xx:xx
[ 39.400805] wlp4s0: send auth to xx:xx:xx:xx:xx:xx (try 1/3)
[ 39.407900] wlp4s0: authenticated
[ 39.412080] wlp4s0: associate with xx:xx:xx:xx:xx:xx (try 1/3)
[ 39.416588] wlp4s0: RX AssocResp from xx:xx:xx:xx:xx:xx (capab=0x411 status=0 aid=5)
[ 39.434650] wlp4s0: associated
[ 39.461998] IPv6: ADDRCONF(NETDEV_CHANGE): wlp4s0: link becomes ready
[ 118.796176] kauditd_printk_skb: 41 callbacks suppressed
[ 118.796181] audit: type=1400 audit(1537802891.203:53): apparmor="DENIED" operation="open" profile="/usr/sbin/cups-browsed" name="/usr/share/cups/locale/" pid=1028 comm="cups-browsed" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[ 118.796192] audit: type=1400 audit(1537802891.203:54): apparmor="DENIED" operation="open" profile="/usr/sbin/cups-browsed" name="/usr/share/locale/" pid=1028 comm="cups-browsed" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[ 335.219698] aufs 4.15-20180219
[ 335.252934] audit: type=1400 audit(1537803107.566:55): apparmor="STATUS" operation="profile_load" profile="unconfined" name="docker-default" pid=1814 comm="apparmor_parser"
[ 335.313886] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 335.315479] Bridge firewalling registered
[ 335.323977] nf_conntrack version 0.5.0 (65536 buckets, 262144 max)
[ 335.517292] Initializing XFRM netlink socket
[ 335.521091] Netfilter messages via NETLINK v0.30.
[ 335.522673] ctnetlink v0.93: registering with nfnetlink.
...