Linux开发机问题汇总
DNS解析问题
在不同场景下遇到过几次,具体表现:
- 不连接有线,只Wifi连接热点
- iOA无法加载扫码,网页无法加载
- ping www.baidu.com 失败
原因其实是DNS解析失败了,查看这个文件 cat /etc/resolv.conf
# This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0 trust-ad
search .
临时修改,添加一个正确的DNS:
nameserver 8.8.8.8
再次重新标准化,就出来一堆DNS,至于这个文件什么时候抽风出错了,没注意到
nameserver 192.168.255.10
nameserver 8.8.8.8
nameserver 10.11.56.23
# Too many DNS servers configured, the following entries may be ignored.
nameserver 10.28.0.21
nameserver 10.28.0.12
nameserver 10.11.56.22
search .
毕竟iOA在Linux上只能说勉强能用。
VSCode代理问题
安装插件报错,但命令行能ping通:
2025-10-20 16:11:15.812 [error] [网络] #2: https://marketplace.visualstudio.com/_apis/public/gallery/vscode/davidfreer/go-to-character-position/latest - error GET Fetch timeout: 10000ms
2025-10-20 16:11:15.813 [error] [网络] #3: https://marketplace.visualstudio.com/_apis/public/gallery/vscode/dbaeumer/vscode-eslint/latest - error GET Fetch timeout: 10000ms
2025-10-20 16:11:15.813 [error] [窗口] Error while getting the latest version for the extension davidfreer.go-to-character-position from https://marketplace.visualstudio.com/_apis/public/gallery/vscode/{publisher}/{name}/latest. Trying the fallback https://www.vscode-unpkg.net/_gallery/{publisher}/{name}/latest Failed
命令行有代理,猜测是VSCode启动时没有从环境读到,需要手动配置:
# id: http.proxy
Http: Proxy
要使用的代理设置。如果未设置,则将从“http_proxy”和“https_proxy”环境变量继承。在 remote development 禁用 Http: Use Local Proxy Configuration 设置时,可在本地设置和远程设置中单独配置此设置。
反正思路就是网络不通就先在Terminal测,如果Terminal能ping通,就大概率是代理问题。
无法访问oa
401 Unauthorized Device
如果您正在PC端访问公司内网,可尝试
刷新当前页面重试
检查iOA登录状态
注销iOA重新登录
如果您正在移动端访问公司内网,可尝试
返回 手机iOA 【重新开启】远程办公
如已经【开启】,请关闭后刷新当前页面重试
以上方式均无法恢复时,请企业微信联系“8000助手”
If the problem has not been solved,please contact 8000 on WeCom.
iOA-工具-修复有线网络
Docker(apt)无法访问网络
能ping通
root@92e9e3eafb56:/# curl -v http://archive.ubuntu.com/ubuntu/
* Trying 185.125.190.81:80...
* Trying 2620:2d:4000:1::103:80...
* Immediate connect fail for 2620:2d:4000:1::103: Network is unreachable
* Trying 2620:2d:4000:1::101:80...
* Immediate connect fail for 2620:2d:4000:1::101: Network is unreachable
* Trying 2620:2d:4000:1::102:80...
* Immediate connect fail for 2620:2d:4000:1::102: Network is unreachable
root@92e9e3eafb56:/# curl -v http://archive.ubuntu.com/ubuntu/
* Trying 91.189.91.83:80...
* Connected to archive.ubuntu.com (91.189.91.83) port 80 (#0)
> GET /ubuntu/ HTTP/1.1
> Host: archive.ubuntu.com
> User-Agent: curl/7.81.0
-> # apt install protobuf-codegen
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following NEW packages will be installed:
protobuf-codegen
0 upgraded, 1 newly installed, 0 to remove and 208 not upgraded.
Need to get 482 kB of archives.
After this operation, 1762 kB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 protobuf-codegen amd64 2.25.2-1
0% [Working]
0% [Working]
每次iOA登录就会打开ipv6….
其他
~/work/compare/slark_origin_temp (skweb_main_2.46 ✔) sudo apt update
sudo: 无法解析主机:vimerzhao-LC8: 域名解析出现暂时性错误
Failed to add a watch for /run/systemd/ask-password: inotify watch limit reached
获取:1 https://packages.microsoft.com/repos/edge stable InRelease [3,590 B]
获取:2 https://packages.microsoft.com/repos/code stable InRelease [3,590 B]
~/work/compare/slark_origin_temp (skweb_main_2.46 ✔) cat /etc/hostname
vimerzhao-LC8
~/work/compare/slark_origin_temp (skweb_main_2.46 ✔) cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 vimerzhao-MS-7E16
The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
sudo vim /etc/hosts sudo: 无法解析主机:vimerzhao-LC8: 域名解析出现暂时性错误