When the newly flashed Raspberry Pi image is enabled,Chances are you're getting weird apt errors:
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 |
of course,more than this,Installing any package would be Package xxx has no installation candidate
Solution
Check out your first /etc/apt/sources.list ,See if the source address inside is commented out,Here mine is normal。
That should be a problem with apt cache,to directory /where/lib/apt Excuting an order sudo rm -r lists
delete all cache,then execute sudo apt update
At this point apt should be able to install various packages correctly。
Original article written by LogStudio:R0uter's Blog » Package xxx has no installation candidate on Raspberry Pi
Reproduced Please keep the source and description link:https://www.logcg.com/archives/3800.html