1.备份官方源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
2.修改官方源
vim /etc/apt/sources.list
3.如果没有安装vim,则提示错误,输入
apt-get install vim
提示磁盘空间将被使用,Do you want to continue? [Y/n],选择y即可。
安装vim.png
4.安装好vim后,再次输入
vim /etc/apt/sources.list
5.删除全部官方源
vim正常模式下命令:gg将光标移动到首行,dG将内容删除到全文末尾
删除后,按i进入插入模式,复制粘贴国内源,如下阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
按esc键,进入正常模式,
按:(英文冒号)键,进入命令模式,输入wq保存退出
更换国内源.png
6.同步更新源source.list,输入命令
apt-get update
update.png
7.更新软件,输入命令
apt-get upgrade
有提示,按y确认即可
upgrade.png
到这里就换好国内源了。
附加:下面是安装人工智能pandas速度慢的解决办法,使用阿里源加速出错,换成了豆瓣的源后成功
pip install -i 国内源 包名
阿里加速出错
豆瓣加速成功.png
豆瓣源:
pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com/simple pandas
感谢您的观看,如果对您有帮助,请点赞,关注,赞赏,谢谢您的支持!
网友评论