解决Ubuntu(20.04)开机、关机、重启慢,有光标闪烁问题

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/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • Shell添加任务计划

    添加任务计划,每30分钟自动执行 /data1/scripts/chk_sds.sh mkdir /data1/scripts echo -e "if [ \ps -C …

    Linux 2023年5月28日
    068
  • 挂载mount

    挂载mount 1.查看系统挂载的磁盘情况 df df -h 2.挂载:mount 将光驱挂在到/mnt目录: mount /dev/cdrom /mnt #mount 准备挂载的…

    Linux 2023年6月11日
    082
  • 巧用 JuiceFS Sync 命令跨云迁移和同步数据

    近年来,云计算已成为主流,企业从自身利益出发,或是不愿意被单一云服务商锁定,或是业务和数据冗余,或是出于成本优化考虑,会尝试将部分或者全部业务从线下机房迁移到云或者从一个云平台迁移…

    Linux 2023年6月14日
    096
  • win11下配置vue3版本

    安装node.js PS:全局需要使用管理员权限打开CMD** 下载nodejs的地址 选择左边就好 下载安装后,选择自己需要安装的盘符,即可,不再叙述。 打开CMD查看node是…

    Linux 2023年6月14日
    089
  • Java — 枚举

    枚举是 JDK5 中引入的特性,由 enum 关键字来定义一个枚举类。 格式: enum 枚举类名 { 枚举项1, 枚举项2, …; 成员变量; 构造方法 成员方法 } 说明:…

    Linux 2023年6月8日
    075
  • redis中key和value的存储大小限制

    String类型:一个String类型的value最大可以存储512M List类型:list的元素个数最多为2^32-1个,也就是4294967295个。 Set类型:元素个数最…

    Linux 2023年5月28日
    0119
  • 解决“WARNINGThe remote SSH server rejected X11 forwarding request.“警告

    使用xshell连接服务器时,出现了”WARNING! The remote SSH server rejected X11 forwarding request.&#…

    Linux 2023年5月27日
    079
  • Golang 实现 Redis(9): 使用GeoHash 搜索附近的人

    本文是使用 golang 实现 redis 系列的第九篇,主要介绍如何使用 GeoHash 实现搜索附近的人。 搜索附近的POI是一个非常常见的功能,它的技术难点在于地理位置是二维…

    Linux 2023年5月28日
    0108
  • Redis基础

    1.简介 Redis (远程字典服务器)是一 个开源的、使用C语言编写的NoSQL数据库。Redis基于内存运行并支持持久化,采用 key-value (键值对)的存储形式,是目前…

    Linux 2023年6月13日
    076
  • CAPL学习笔记

    CAPL是CANOE自带的一种编程语言,要和CANOE中的一个节点绑定在一起。它的文件后缀是.can。 两种添加方式:1. 在simulation setup中增加一个网络节点,配…

    Linux 2023年6月13日
    072
  • PHP str_repeat()

    str_repeat str_repeat() 函数把字符串重复指定的次数。 示例: function strRepeat() { echo str_repeat("*&…

    Linux 2023年6月7日
    0169
  • 常用命令记录

    npm仓库查看和修改 npm config set registry https://registry.npm.taobao.org #设置使用淘宝提供的npm仓库 npm con…

    Linux 2023年5月27日
    069
  • web安全之反向代理配置X-Frame-Options实现防盗链和防止点击劫持攻击

    介绍 http响应头安全策略,从http头文件的方面,利用参数设置开启浏览器的安全策略,来实现相关的安全机制 X-Frame-Options HTTP响&am…

    Linux 2023年6月6日
    0109
  • 多用户共享文件

    假设有三个用户:Tom Jerry Bob.其中,tom和Jerry都属于market部,Bob属于tech部,请在/usr目录下创建两个用户共享的目录market和public,…

    Linux 2023年6月13日
    081
  • git reset 命令删除本地文件怎么恢复

    执行 git reflog命令可以看到曾经执行过的操作,还有版本序号。 执行 git reset –hard HEAD@{【填那个序号】}就可以恢复本地删除的文件了! …

    Linux 2023年6月14日
    099
  • 正则表达式

    正则表达式:REGEXP,REGular EXPression。正则表达式分为两类: Basic REGEXP(基本正则表达式 Extended REGEXP(扩展正则表达式) 元…

    Linux 2023年6月7日
    0108
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球