博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
VMware Worktation[Linux]Ubuntu 20.04更换源
阅读量:3958 次
发布时间:2019-05-24

本文共 1707 字,大约阅读时间需要 5 分钟。

1 备份原来的源

cp -ra /etc/apt/sources.list /etc/apt/sources.list.bak

2 查看ubuntu的代号

要知道当前系统的代号,可以用以下命令:

lsb_release -a

在这里插入图片描述

3 到相应的源网址下看下这个源存在不存在

这边用的是阿里云的源,里面是有我版本的源的

链接: .
http://mirrors.aliyun.com/ubuntu/dists/

在这里插入图片描述

4 编写sources.list配置文件的内容

然后把’focal’换成上面Condename里面的版本号

#阿里源deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiversedeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

5 修改sources.list配置文件

sudo gedit /etc/apt/sources.list

把上面的内容复制到终端里面就可以弹出sources.list配置文件,直接把里面的内容全部删掉,替换成4里面的内容就行。写完记得保存。

在这里插入图片描述

6 重启虚拟机

一定要重启!!!一定要重启!!!一定要重启!!!

不然会出现这个问题。就是因为没有重启,我反复搞了好几天都没搞出来。
在这里插入图片描述

7 执行更新指令

sudo apt-get updatesudo apt-get upgrade

在这里插入图片描述

8 出现了这个问题 :E: 仓库 “http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu focal Release” 没有 Release 文件。

在这里插入图片描述

解决方法:

链接: .

https://blog.csdn.net/qq_44796372/article/details/116095573?spm=1001.2014.3001.5501
删除 webupd8team/sublime-text-3这个ppa文件,

删除命令:

sudo add-apt-repository --remove ppa:/webupd8team/sublime-text-3

9 最后再次更新源就修改好了

你可能感兴趣的文章
Python使用heapq实现小顶堆(TopK大)、大顶堆(BtmK小)
查看>>
用python的matplotlib包绘制热度图
查看>>
matplot pip安装
查看>>
序列S的所有可能情况
查看>>
在Linux上用pip安装scipy
查看>>
随机salt二次加密及hash加密漫谈
查看>>
linux 技巧:使用 screen 管理你的远程会话
查看>>
同时装了Python3和Python2,怎么用pip?
查看>>
linux tar 解压缩zip文件报错的解决
查看>>
vim,ctag和Taglist
查看>>
Ubuntu的apt命令详解
查看>>
Ubuntu Server 设置sshd
查看>>
sort,uniq命令的使用。
查看>>
linux下md5加密(使用openssl库C实现)
查看>>
openssl、MD5的linux安装方法
查看>>
DevC++ 工程没有调试信息的解决办法
查看>>
http消息长度的确定
查看>>
手机和电脑如何连接蓝牙
查看>>
HTTP协议参数
查看>>
wireshark检索命令
查看>>