ip link show #查看当前网卡名 ip set netplan set ethernets.enp6s18.dhcp4=true #开启DHCP自动获取IP netplan apply #应用网卡配置 apt install -y vim #安装vim编辑器 vim /etc/netplan/[你的网卡配置文件].yaml
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #备份 vim /etc/apt/sources.list #将里面内容替换为下面的镜像
清华大学镜像站
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse # deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
更新本地缓存
sudo apt-get update
pip换源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/