Ubuntu 16.04 启动时间

Ubuntu 16.04 启动时间

我有一台安装了 Ubuntu 16.04 的 HP 笔记本电脑(与 Windows 10 双启动)。系统启动需要 1 分钟以上,如下所示:

$ systemd-analyze time && systemd-analyze blame
Startup finished in 3.504s (kernel) + 1min 7.512s (userspace) = 1min 11.016s
         24.675s apt-daily.service
         16.924s apt-daily-upgrade.service
         15.427s dev-sda4.device
         11.694s systemd-journald.service
         11.549s systemd-tmpfiles-setup-dev.service
          8.627s systemd-sysctl.service
          6.496s NetworkManager-wait-online.service
          5.204s snapd.service
          3.586s gpu-manager.service
          3.033s systemd-modules-load.service
          2.285s NetworkManager.service
          2.067s udisks2.service
          1.856s thermald.service
          1.633s ModemManager.service
          1.595s accounts-daemon.service
          1.468s apparmor.service
          1.368s lightdm.service
          1.181s iio-sensor-proxy.service
          1.035s systemd-rfkill.service
           986ms grub-common.service
           915ms keyboard-setup.service
           778ms upower.service
           734ms plymouth-start.service

中央处理器sudo lscpu(也可以看看inxi -C

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 42
Model name:            Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz
Stepping:              7
CPU MHz:               1995.596
CPU max MHz:           2900,0000
CPU min MHz:           800,0000
BogoMIPS:              3991.19
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
NUMA node0 CPU(s):     0-7
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts

图形硬件lspci | grep VGA(也可以看看inxi -G

00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Whistler [Radeon HD 6730M/6770M/7690M XT] (rev ff)`

那么,我该怎么做才能加快启动速度(如果可能的话)?

答案1

推荐链接通过@fixi7 在第一条评论中,我找到了我的问题的解决方案(它似乎有效),即执行:sudo systemctl edit apt-daily.timer并将以下文本粘贴到编辑器窗口中:

# apt-daily timer configuration override
[Timer]
OnBootSec=15min
OnUnitActiveSec=1d
AccuracySec=1h
RandomizedDelaySec=30min

现在,的输出$ systemd-analyze time && systemd-analyze blame 是:

Startup finished in 3.454s (kernel) + 27.151s (userspace) = 30.605s
     15.729s dev-sda4.device
     11.691s systemd-tmpfiles-setup-dev.service
     10.565s systemd-sysctl.service
      5.548s udisks2.service
      5.384s NetworkManager-wait-online.service
      4.860s snapd.service
      3.605s console-setup.service
      2.556s gpu-manager.service
      2.027s ModemManager.service
      1.996s lightdm.service
      1.982s accounts-daemon.service
      1.817s apparmor.service
      1.660s iio-sensor-proxy.service
      1.416s systemd-rfkill.service
      1.371s thermald.service
      1.240s keyboard-setup.service
      1.183s systemd-modules-load.service
       979ms apt-daily.service
       924ms systemd-tmpfiles-setup.service
       911ms systemd-journald.service
       818ms dev-loop0.device
       734ms irqbalance.service
       606ms avahi-daemon.service

启动时间大大减少。

相关内容