debian系统报libncurses6 : Depends: libtinfo6 (= 6.2+20201114-2+deb11u1) but 6.4-4 is to be installed

字号+ 编辑: 国内TP粉 修订: 种花家 来源: 2023-09-11 我要说两句(0)

如果忘记了之前是怎么配置镜像源的话, 稍微不小心就掉到这个坑里。

今天小编在制作镜像时发现竟然安装不了基本的linux命令,例如ps等,报类似以下的错误

libncurses6 : Depends: libtinfo6 (= 6.2+20201114-2+deb11u1) but 6.4-4 is to be installed

重新安装libtinfo6的指令也没用

apt-get --reinstall install libtinfo6
Reinstallation of libtinfo6 is not possible, it cannot be downloaded.

或者提示各种依赖错误

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 bash : PreDepends: libtinfo6 (>= 6) but it is not going to be installed
 ncurses-bin : PreDepends: libtinfo6 (>= 6.3) but it is not going to be installed
 util-linux : PreDepends: libtinfo6 (>= 6) but it is not going to be installed
              Recommends: sensible-utils but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

网上有说换回官方的源就ok了,这确实是一个万能方法,可是网络实在太差呀。安装一个包要等半天。最后一查,原来是镜像源没有对应正确的系统版本,版本搞错了。

比如你用的是debian11,却用的debian10的镜像源,就会报这个错误。

修改镜像源的方法, 编辑一下sources.list文件:

vi /etc/apt/sources.list
deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware

之后更新一下文件列表就可以了

apt-get update

安装你想安装的文件吧。

阅完此文,您的感想如何?
  • 有用

    0

  • 没用

    0

  • 开心

    0

  • 愤怒

    0

  • 可怜

    0

1.如文章侵犯了您的版权,请发邮件通知本站,该文章将在24小时内删除;
2.本站标注原创的文章,转发时烦请注明来源;
3.交流群: PHP+JS聊天群

相关课文
  • Linux系统下word文档转成pdf的办法

  • ubuntu和debian安装nginx或者tengine报错, 找不到pcre依赖库的解决办法

  • linux终端下借助awk命令查询筛出网站access.log日志里的统计信息

  • 常见的web中间件请求返回状态码

我要说说
网上宾友点评