好网站页面,wordpress 暂时关闭,vuejs 可做网站吗,wordpress注入在网上搜了好多设置国内镜像源#xff0c;都写的乱七八糟的#xff0c;都是随便换#xff0c;最后还是换得一堆问题。 镜像源也是跟版本一一对应的#xff0c;不能随便一个国内源就还过去用#xff0c;否则会出现各种各样的问题#xff0c;我也是吃过亏之后才发现的。
国…在网上搜了好多设置国内镜像源都写的乱七八糟的都是随便换最后还是换得一堆问题。 镜像源也是跟版本一一对应的不能随便一个国内源就还过去用否则会出现各种各样的问题我也是吃过亏之后才发现的。
国内有很多Ubuntu的镜像源包括阿里的、网易的还有很多教育网的源比如清华源、中科大源。
这里我用阿里云
查询版本
先查询自己系统的版本号 命令lsb_release -a macw:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
macw:~$ 可以看出我系统版本是 Ubuntu 20.04.6 LTS注意这个开发代号CodenameUbuntu每一个版本都有一个代号这个一定要跟国内源对应否则会出问题。
阿里云镜像
镜像地址
通过以下地址可以看到阿里云Ubuntu各个版本的镜像地址从中选择自己的系统版本就好一定要选择Codename对应的版本。 镜像地址: 阿里云Ubuntu镜像https://developer.aliyun.com/mirror/ubuntu
ubuntu 20.04 LTS (focal) 配置如下
我系统版本是20.04所以可以从下面镜像信息中看到都是focal代号的。
deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse# deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
更换方法
1.备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.back2.编辑
打开vim编辑器把sources.list文件中所有的deb文件全部注释掉或者删除掉然后把上面给的国内镜像复制去就可以。
vim /etc/apt/sources.list3.更新
sudo apt update
sudo apt upgrade其他镜像
清华源
地址https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
# 默认注释了源码镜像以提高 apt update 速度如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiversedeb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse# 预发布软件源不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse