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

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

2022年06月27日 8259点热度 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 评论
内联反馈
查看所有评论

老杨

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

搜索
最新 热点 随机
最新 热点 随机
中国是不是体育强国? 成功的必备因素 关于华为 别再侮辱我的智商 春秋航空让人长见识 第二青春计划失败 第二青春计划 模型训练错误RuntimeError: expected scalar type Half but found Float 加载onnx模型进行推理 PyTorch模型转onnx格式
浅谈Web2.0 个人购买NAS有什么用? 关于房子,我可能真的错了 胜利 童年趣事之自行车 推荐一个网络同步工具Dropbox 光棍节快乐 CSS中使div垂直水平居中 童年趣事之哭鼻子 婚礼压力高考及其他
最新评论
  • 关于华为上的老杨确实,苹果手机系统还是有优势的。
  • 关于华为上的乱云AKAY自从换了苹果手机后,对手机再没以前那样热爱研究了,主要是系统省心。
  • 第二青春计划失败上的老杨第二都失败了,第三就算了吧。
  • 春秋航空让人长见识上的老杨应该提供一点水,至少给不想买水的人一个选择的空间。
  • 别再侮辱我的智商上的老杨那个很好,很值得。
  • 关于华为上的老杨Next系统基本没广告。大部分广告都可以关掉吧,我记得我写过一个文章,…
  • 第二青春计划失败上的xqiushi开始第三青春计划吧。
  • 春秋航空让人长见识上的xqiushi那个桌板能放下小米多看电子书,还是不错的。 这个矿泉水市面上没有,特供…
  • 别再侮辱我的智商上的xqiushi只投了那100亿的项目。
  • 关于华为上的xqiushi今年我爸的手机也换成华为,家庭里手机基本都是华为。最不满意的一点就是广…

Google java jsp linux QQ wordpress 中国 习惯 人生 公司 决定 博士 博客 同学 国家 大学 学习 实验室 家 小说 工作 开始 思考 情感 手机 技术 推荐 插件 数据库 文件 晴迷星途 朋友 生活 电影 相声 程序 笔记 网站 网络 置顶 美国 评论 软件 音乐 项目

关注公众号

COPYRIGHT © 2020 老杨说话的地方. ALL RIGHTS RESERVED.

THEME KRATOS YANG Modified BY 老杨

鲁ICP备17014997号-4

鲁公网安备 37021302000754号