[Contribute Advice] 20.04的终端输入sudo apt update会卡很久才显示输入密码提示。
Tofloor
poster avatar
mcxx123
deepin
2022-03-27 20:01
Author

20.04的终端输入sudo apt update会卡很久才显示输入密码提示。 以前的老系统不会出现这种情况,不知道什么原因。有遇到的么?

Reply Favorite View the author
All Replies
liwl
deepin
2022-03-27 20:27
#1

虚拟机?

Reply View the author
mcxx123
deepin
2022-03-27 20:34
#2
liwl

虚拟机?

真机

Reply View the author
andktan
deepin
2022-03-27 21:38
#3

我的真机,经常是卡几秒才出要求密码输入的显示,但有时候很快马上就出。

习惯了,不知道你点卡多长时间,几分钟,几小时confused

Reply View the author
deepin-superuser
deepin
2022-03-27 22:17
#4

貌似是 hosts 的问题

https://cynthiachuang.github.io/Fix-Solve-the-Slow-Response-of-Sudo/

Reply View the author
mcxx123
deepin
2022-03-28 02:12
#5
andktan

我的真机,经常是卡几秒才出要求密码输入的显示,但有时候很快马上就出。

习惯了,不知道你点卡多长时间,几分钟,几小时confused

也不是每次都这样,一般5秒以上,有时更多时间。

Reply View the author
deepinuser17
deepin
2022-03-28 07:18
#6

查看一下:

cat /etc/nsswitch.conf

Reply View the author
andktan
deepin
2022-03-28 16:42
#7
deepinuser17

查看一下:

cat /etc/nsswitch.conf

请教一 下我这个有没有问题呢?image.png

Reply View the author
mcxx123
deepin
2022-03-28 20:02
#8
deepinuser17

查看一下:

cat /etc/nsswitch.conf

/etc/nsswitch.conf

Example configuration of GNU Name Service Switch functionality.

If you have the glibc-doc-reference' and info' packages installed, try:

`info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat
gshadow: files

hosts: files dns myhostname
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis

Reply View the author
deepinuser17
deepin
2022-04-11 06:37
#9

这是我的机器上设置:

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         files
group:          files
shadow:         files
gshadow:        files

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

 

如果不用ldap, 或其它账户服务器, 把passwd, group, shadow, gshadow的值改成files就行了

Reply View the author
ThinKinG
deepin testing team
2023-03-29 17:53
#10

/etc/hosts 文档缺少了这么一行,需要手动添加(假设计算机名称是 mydeepin):

127.0.1.1 mydeepin
Reply View the author