老杨说话的地方
  • 首页
  • 关于老杨
  • 博客时间
  • 文章分类
    • 人生感悟
    • 信息技术
    • 往事随风
    • 情感随笔
    • 文学创作
    • 生活记录
    • 评论杂谈
    • 人工智能
  • 留言本
我是老杨
张驰有度 宠辱不惊
  1. 首页
  2. 信息技术
  3. Linux
  4. 正文

Debian在使用apt安装软件时提示package has no installation candidate

2022年06月27日 10566点热度 6人点赞 0条评论

在使用Debian的官方源安装操作系统后,部分情况下可能无法使用apt安装任何软件。

使用命令

apt update

没有错误,但是也没有更新任何内容。此时,安装任何软件都提示:

package has no installation candidate

这是因为apt的源设置的不对,默认安装的情况下,源中包含的软件库非常有限。

这时候,如果打开apt的source文件,就可以看到:

root@ouc:~# vim /etc/apt/sources.list
# deb cdrom:[Debian GNU/Linux 11.3.0 _Bullseye_ - Official amd64 NETINST 20220326-11:22]/ bullseye main

#deb cdrom:[Debian GNU/Linux 11.3.0 _Bullseye_ - Official amd64 NETINST 20220326-11:22]/ bullseye main

deb http://security.debian.org/debian-security bullseye-security main
deb-src http://security.debian.org/debian-security bullseye-security main

# bullseye-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.~

可以看到这里面的源很少,不完整。可以设置为阿里云的源。

deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free

如果不想输入,可以直接使用在线的一些资源进行覆盖。

cd /etc/apt/
mv sources.list sources.list.old
wget https://dataset.yangyq.net/sources.list

完成之后,再进行更新和安装就可以了。

标签: apt debian package 安装 软件
最后更新:2022年06月27日

老杨

博士,非博学之士;讲师,讲所学所知。糊涂半生,虚度半世,唯愿平淡快乐,度过此生。

点赞
guest

guest

0 评论

老杨

博士,非博学之士;讲师,讲所学所知。糊涂半生,虚度半世,唯愿平淡快乐,度过此生。

搜索
最新 热点 随机
最新 热点 随机
别成为AI的奴隶 给阿嬷的情书 信息焦虑综合症 PUA 人的悲喜并不相通 RIME输入法万象拼音输入方案更改自定义短语文件的方法 禁用RIME输入法万象拼音输入方案表情的办法 幸福者避让原则 WordPress插件WP-Editor.md代码语法无法高亮问题的解决方案 RIME的自动化配置与同步
整理C#笔记 魅族情结 开张大吉 雅可比迭代求解线性方程组C语言 回家了 那一年,2009 童年趣事之哭鼻子 逢赌必输 是谁将你害成这样 WordPress升级PHP8以后出现的警告
最新评论
  • 第二青春计划失败上的老杨这种平台挺多的,但是应该没啥用,能有啥情绪价值比躺着刷手机更好呢?
  • 春秋航空让人长见识上的老杨已经遇到了,额外支付了170,托运登机行李,还不是托运行李。
  • PUA上的老杨那很好,恭喜你
  • 信息焦虑综合症上的老杨可以尝试改变。
  • 别成为AI的奴隶上的老杨现在很多人离开AI已经不知道怎么工作了。
  • 第二青春计划失败上的shanshan建议开发一个适合P人的工作生活计划平台,完不成没什么惩罚、但是完成了有…
  • 春秋航空让人长见识上的shanshan还有部分机型里20寸箱子应该上不了机,且没有免费行李托运额度。托运费超…
  • 人的悲喜并不相通上的shanshan这个世界精致利己主义者太多啦!
  • PUA上的shanshan我还是相信批评使人进步,我很珍惜给我提出宝贵意见的人。
  • 信息焦虑综合症上的shanshan字字诛心啊老杨!
文章分类
关注公众号

COPYRIGHT © 2026 老杨说话的地方 版权所有

THEME KRATOS YANG Modified BY 老杨

鲁ICP备17014997号-4

鲁公网安备 37021302000754号