后续补充: 一定要注意镜像源版本的问题!

有的文章提供的镜像源的版本是focal,你的系统版本可能不一样,是jammy, 直接复制别人的镜像源,版本对不上就会一直报错。

可通过 lsb_release -a 查看版本,看codename就可以知道自己的镜像源版本。

 首先确保网络连接了,之后参考了这篇博客,就解决了

解决 Ubuntu E:无法定位软件包问题-CSDN博客https://blog.csdn.net/qq_41428418/article/details/125265190?ops_request_misc=&request_id=&biz_id=102&utm_term=ubuntu%E8%BD%AF%E4%BB%B6%E5%8C%85%E6%97%A0%E6%B3%95%E5%AE%9A%E4%BD%8D&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-125265190.142%5Ev96%5Epc_search_result_base9&spm=1018.2226.3001.4187还没有安装vim,使用gedit。

保存后退出即可!

后续又报错了,软件包有未满足的依赖关系,查资料发现还是这个文件的问题

在终端输入

lsb_release -a

查询得知自己的codename为jammy,需要添加jammy的下载源

打开文件

sudo gedit /etc/apt/sources.list

 根据自己的系统配置对应的镜像源文件,将文件修改为下列内容

deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse

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

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

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

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

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

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

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

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

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

deb https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse

deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse

deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

deb-src https://mirrors.ustc.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ jammy main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ jammy-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ jammy-updates main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ jammy-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ jammy-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ jammy main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ jammy-security main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ jammy-updates main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ jammy-proposed main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ jammy-backports main restricted universe multiverse

重新输入

sudo apt-get update

sudo apt-get upgrade

相关阅读

评论可见,请评论后查看内容,谢谢!!!评论后请刷新页面。