1. 问题描述
在开关机或重启时,等待时间很长,大约1分30秒,光标闪烁。
[En]
When switching on and off, or rebooting, the waiting time is very long, about 1 minute and 30 seconds, and the cursor flashes.
2. 问题解析
- 等待时间较长。在机器开机和关机时,可能需要后台打开或关闭某些程序。这些程序花费的时间是系统设置的默认时间,大约90秒,在系统可以打开或关闭之前只需要90秒。
[En]
the waiting time is long. It is possible that some programs have to be opened or closed by the background when the machine is turned on and off. The time taken by these programs is the default time set by the system, about 90 seconds, and only 90 seconds before the system can be turned on or off.*
- 光标闪烁是对后台一系列活动的简化这表明背景中正在进行一系列活动,但我们看不到它们。所以它让我们感觉它被卡住了。
[En]
cursor flashing is a simplification of a series of activities in the background. It indicates that there are a series of activities going on in the background, but we can’t see them. So it makes us feel like it’s stuck.*
如果我们在终端输入:
sudo gedit /etc/default/grub
在打开的文件中,找到以下内容:
[En]
In the open file, find the following:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
将其改为:
GRUB_CMDLINE_LINUX_DEFAULT=""
并保存并重新启动。我们会在手机开机和关机时看到后台的动作,如果我们不想看到,只需填写删除的内容。
[En]
And save and restart. We will see the action in the background when the phone is turned on and off, and if we don’t want to see it, just fill in the deleted content.
当我们再次开机关机时,我们会发现后台有这样一个动作:
[En]
When we turn the phone on and off again, we will find that there is such an action in the background:
A stop job is running for Snappy daemon (1min 16s / 1min 30s)
正是它导致了关机慢。
3. 问题解决
打开终端,输入:
sudo su # 成为root用户
vim /etc/systemd/system.conf
#ubuntu默认没有开启root权限,我们需要以下操作:
sudo passwd root
#然后设置密码就行
修改以下内容:
#DefaultTimeoutStartSec=90s
#DefaultTimeoutStopSec=90s
改为:
DefaultTimeoutStartSec=3s # 将#去掉,90改为3
DefaultTimeoutStopSec=3s
然后,加载修改的配置:
systemctl daemon-reload
如果对vim不熟悉的话,可以在文件夹中进入 /etc/systemd
文件夹, 在文件夹中打开终端,输入:
sudo chmod 777 system.conf # 修改system.conf只读文件为读写文件
再在文件夹中打开 system.conf
文件进行编辑,编辑完保存。
然后打开终端,将文件设置为只读:
[En]
Then open the terminal and set the file to read-only:
sudo chmod 644 system.conf # 修改system.conf读写文件为只读文件
最后,您仍然需要加载修改后的配置:
[En]
Finally, you still need to load the modified configuration:
systemctl daemon-reload
上述操作完成后,应能解决切换慢的问题。
[En]
After the above operation, the problem of slow switch should be solved.
Original: https://www.cnblogs.com/xiaotong-sun/p/16138855.html
Author: Xiao·Tong
Title: 解决Ubuntu(20.04)开机、关机、重启慢,有光标闪烁问题
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/523846/
转载文章受原作者版权保护。转载请注明原作者出处!