本文主要是介绍Ubuntu apt 安装gedit,报错 E: Unable to correct problems, you have held broken packages.,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Ubuntu apt 安装gedit,报错 E: Unable to correct problems, you have held broken packages.
在安装软件的时候报错:
网上查询了很多资料,还重装了一次,都无法解决。
之后在CSDN博主「woshiheweigui」的文章中看到相似情况,
其原文链接:https://blog.csdn.net/woshiheweigui/article/details/115557020
发现是切换的国内源的问题,刚好备份了之前的源。(所以建议在切换国内镜像源同时备份之前的)发现自己的Ubuntu版本是2020的需要focal类型的源,
但切换的国内源是2018的bionic类型的源。
修改之前的:
#清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
于是又进行了修改:
#清华源
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 multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
Ubuntu各个版本的需要的源版本如下:
Ubuntu 12.04 (LTS)代号为precise。
Ubuntu 14.04 (LTS)代号为trusty。
Ubuntu 15.04 代号为vivid。
Ubuntu 15.10 代号为wily。
Ubuntu 16.04 (LTS)代号为xenial。
Ubuntu 18.04 (LTS)代号为bionic。
Ubuntu 20.04 (LTS)代号为focal。
然后再次尝试安装gedit
sudo apt install gedit
安装完成
其他软件同理
这篇关于Ubuntu apt 安装gedit,报错 E: Unable to correct problems, you have held broken packages.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!