出现这种情况的原因是与您之前在系统上安装但未卸载的应用程序相关的服务在系统启动时会自动启动。
例如,当您安装 MySQL Server 时,与 MySQL Server 相关的服务会在系统启动时自动启动。如果你使用的是你作为实验室使用的系统,我认为没有必要在每次系统启动时自动运行 MySQL Server 相关服务。当您想使用 MySQL 服务器时,您可以手动启动 MySQL 服务器相关服务。
要管理服务,请按照以下步骤操作。
1。上市服务
# Finding services started at boot
service --status-all
# Listing services started at boot
initctl list
# Listing services (systemd is available in Ubuntu, `systemctl` command active)
sudo systemctl list-unit-files --state=enabled
2。减少 CPU 负载
您可以使用preload 来安装常用的应用程序。 preload 是一个后台运行的守护进程,用于分析频繁运行的应用程序。
# Installing `Preload`
sudo apt-get install -y preload
3。管理服务
systemd 启动、停止、启用和禁用“单元”。我们将使用Hddtemp 程序来测试管理服务。
# Installing The Hddtemp
sudo apt-get install hddtemp
# Starting The Hddtemp
sudo systemctl start hddtemp.service
# Restarting The Hddtemp
sudo systemctl restart hddtemp
# Stop The Hddtemp
sudo systemctl stop hddtemp
# Get More Information About A Service
sudo systemctl status hddtemp
4。管理应用程序(重启)
# Initialize at boot of the volume
sudo systemctl enable hddtemp
# Both activating and initializing a volume
sudo systemctl enable --now unit
# Disabling a volume
sudo systemctl disable hddtemp
# Find out if a volume is active
sudo systemctl is-enabled unit
建议
如果系统中运行的应用程序过多,请关闭您不使用的应用程序(服务、单元)。此外,禁用您不使用并在后台运行的应用程序。