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

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

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

老杨

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

搜索
最新 热点 随机
最新 热点 随机
连接mysql时报错Public Key Retrieval is not allowed的解决方法 宝塔面板中MySQL无法启动的错误 文件格式的一些说明和思考 鄙视链 使用VS Code和Flask框架开发基于Python的Web应用 MySQL数据库操作错误Lock wait timeout exceeded; try restarting transaction 宝塔面板安装phpmyadmin访问502错误 使用宝塔面板和Docker安装Bitwarden Gitlab数据迁移后报错 Gitlab恢复数据(数据迁移)
连接mysql时报错Public Key Retrieval is not allowed的解决方法
晴迷星途10知己知彼 习惯“裸奔” 推脱 老杨首页图片幻灯实现方法 BSBJ9:试用JDBC连接数据库 对不起,我买了个Windows7 博物馆奇妙夜 我为什么坚持独立博客 晴迷星途47上钩 你只能相信
最新评论
  • 文件格式的一些说明和思考上的老杨差不多吧,基本上只要是查询,都有一定的优势,尤其是从一大堆数据中查1-…
  • 文件格式的一些说明和思考上的xqiushi可以理解为数据库在“遍历”查询有优势?
  • Linux系统终端没有颜色上的xqiushi都不多。
  • 文件格式的一些说明和思考上的老杨不能这么说,数据库的目的是为了检索。如果程序读取的数据,每次都是全部的…
  • 鄙视链上的老杨这种解释还挺有趣的,学习了。
  • 使用宝塔面板和Docker安装Bitwarden上的老杨是的,我之前就在群晖里面放着,后来放到服务器了。 用浏览器同步感觉还是…
  • Linux系统终端没有颜色上的老杨MacOS,命令行用的多吗?
  • 使用https和客户端请求Gitlab时报证书的错误:unable to verify the first certificate上的老杨git是一种管理代码的软件,gitlab和github,都是基于git…
  • 文件格式的一些说明和思考上的xqiushi原来数据库是最“高阶”数据存储方式啊
  • 鄙视链上的xqiushi泰费尔及学生的一些理论可以解释这些现象,“我群中心主义”。大概是这样子…

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

关注公众号
广告

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

THEME KRATOS YANG Modified BY 老杨

鲁ICP备17014997号-4

鲁公网安备 37021302000754号