当新刷好的树莓派镜像启用时,你有可能会遇到奇怪的 apt 错误:
1 2 3 4 5 6 7 8 9 |
root@raspberrypi:/home/pi# apt install default-jre Reading package lists... Done Building dependency tree... Done Reading state information... Done Package default-jre is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'default-jre' has no installation candidate |
当然,不止这一个,安装任何包都会是 Package xxx has no installation candidate
解决办法
首先查看你的 /etc/apt/sources.list ,看看里边的源地址是不是都被注释掉了,这里我的是正常的。
那应该就是 apt 缓存的问题,到目录 /var/lib/apt 执行命令 sudo rm -r lists
删除全部缓存,然后执行 sudo apt update
此时 apt 应该就可以正确安装各种包了。
本文由 落格博客 原创撰写:落格博客 » Package xxx has no installation candidate on Raspberry Pi
转载请保留出处和原文链接:https://www.logcg.com/archives/3800.html