ubuntu更改更新源

参考https://blog.csdn.net/weixin_44284939/article/details/122647791
更改完镜像源之后,在后续的软件安装中发现总是报如下的错误:

列软件包有未满足的依赖关系:

aptitude : 依赖: libapt-pkg5.0 (>= 1.1) 但是它将不会被安装
推荐: libparse-debianchangelog-perl 但是它将不会被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。。

查询自己的Ubuntu系统属于哪种版本

 lsb_release -c 

注意是focal还是bionic

sudo vim /etc/apt/sources.list
# 阿里云镜像源focal
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# 阿里云镜像源bionic 
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-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed 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-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

保存后更新
sudo apt update
sudo apt upgrade

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
更新Ubuntu 18.04的软件,请按照以下步骤操作: 1. 打开终端。 2. 输入以下命令,备份当前的列表: ``` sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak ``` 3. 执行以下命令,打开列表文件: ``` sudo nano /etc/apt/sources.list ``` 4. 在文件中,注释掉原来的地址,添加新的地址。具体操作方法如下: - 注释掉原来的地址:在每行地址的前面添加“#”号,表示该行被注释掉了。 ``` #deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted #deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted #deb http://cn.archive.ubuntu.com/ubuntu/ bionic universe #deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates universe #deb http://cn.archive.ubuntu.com/ubuntu/ bionic multiverse #deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates multiverse #deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse #deb http://security.ubuntu.com/ubuntu bionic-security main restricted #deb http://security.ubuntu.com/ubuntu bionic-security universe #deb http://security.ubuntu.com/ubuntu bionic-security multiverse ``` - 添加新的地址:在文件末尾添加以下地址(可以根据自己的需要修改): ``` deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse ``` 5. 保存文件并退出编辑器。 6. 输入以下命令,更新列表并升级软件: ``` sudo apt-get update && sudo apt-get upgrade ``` 7. 等待更新完成后,重启计算机。 现在,您的Ubuntu 18.04已经更新到最新的软件了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值