如何做一个门户网站,如果制作个人网站,央企做的好的网站,wordpress导航页面设置密码文章目录 环境变量配置apt换源apt安装#xff0c;测试是否能通外网可能出现的问题#xff1a;Temporary failure resolving 参考 背景#xff1a;公司电脑是局域网#xff0c;通过走代理来连接外网
wsl1 ubuntu想要通过来连接宿主机的局域网代理#xff0c;访问外网
可以… 文章目录 环境变量配置apt换源apt安装测试是否能通外网可能出现的问题Temporary failure resolving 参考 背景公司电脑是局域网通过走代理来连接外网
wsl1 ubuntu想要通过来连接宿主机的局域网代理访问外网
可以先在ubuntu上测试下走代理的网络注意不能用pingping不走代理可用curl测试
curl -x http://your_ip:your_port http://www.baidu.com # your_ip:your_port更改为宿主机的代理ip和端口环境变量配置
配置在/etc/profile.d目录下新建个.sh文件vim /etc/profile.d/http_proxy.sh
export http_proxyhttp://your_ip:your_port # your_ip:your_port更改为宿主机的代理ip和端口
export https_proxyhttp://your_ip:your_port # your_ip:your_port更改为宿主机的代理ip和端口然后source /etc/profile。
注配置在/etc/profile.d目录会对所有用户生效如果配置在~/.bashrc只会对当前用户生效。
apt换源
中科大镜像的各种源https://mirrors.ustc.edu.cn/
【重要】换源教程https://mirrors.ustc.edu.cn/help/ubuntu.html
sudo sed -i s//.*archive.ubuntu.com//mirrors.ustc.edu.cng /etc/apt/sources.list
sudo sed -i s/security.ubuntu.com/mirrors.ustc.edu.cn/g /etc/apt/sources.list一般情况下将 /etc/apt/sources.list 文件中 Ubuntu 默认的源地址 http://archive.ubuntu.com/ 替换为 http://mirrors.ustc.edu.cn/ 即可。 原版url
http://archive.ubuntu.com/ubuntu/
http://security.ubuntu.com/ubuntu/换源url
https://mirrors.ustc.edu.cn/ubuntu/apt安装测试是否能通外网
sudo su到root用户
apt update
apt install net-tools # 包含ifconfig
apt install tree
# apt upgrade # 可选update是更新软件列表upgrade是更新软件 可能出现的问题Temporary failure resolving
我的情况是并不需要配置DNS/etc/resolv.conf 和 /etc/wsl.conf只要做好前面的操作就可以了。
可选最后把/etc/wsl.conf设置如下这样设置wsl ubuntu每次重启还是会自动分配不同的网关ip
[network]
generateResolvConf true参考
为 WSL2 一键设置代理WSL通过WINDOWS走代理Accessing network applications with WSL 【微软官方文档】Temporary failure resolving——Ubuntu DNS未配置报错与解决