geerlingguy / ansible-for-devops

Ansible for DevOps examples.
https://www.ansiblefordevops.com
MIT License
8.51k stars 3.48k forks source link

Pi4 aarch64 FAILED! => "E: Package 'python-apt' has no installation candidate #565

Open angelperezleon opened 1 year ago

angelperezleon commented 1 year ago

TASK [Update apt repo and cache] *********************************************** fatal: [pi4]: FAILED! => {"changed": false, "cmd": "apt-get install --no-install-recommends python-apt -y -q", "msg": "E: Package 'python-apt' has no installation candidate", "rc": 100, "stderr": "E: Package 'python-apt' has no installation candidate\n", "stderr_lines": ["E: Package 'python-apt' has no installation candidate"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nPackage python-apt is not available, but is referred to by another package.\nThis may mean that the package is missing, has been obsoleted, or\nis only available from another source\nHowever the following packages replace it:\n python3-apt-dbg:armhf python3-apt:armhf python3-apt-dbg python3-apt\n python-apt-doc python-apt-common\n\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "Package python-apt 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", "However the following packages replace it:", " python3-apt-dbg:armhf python3-apt:armhf python3-apt-dbg python3-apt", " python-apt-doc python-apt-common", ""]}

Anyone else getting this when trying to update via? ansible-playbook /etc/ansible/update-basic.yml

I have 4 other Pi4 on the host file which update fine pi3's and 4's it just this 64-bit RaspbianOS aarch64 that has problems updating via ansible.

syedayyan-3300 commented 10 months ago

The error indicates that the package 'python-apt' is not available in the repositories that your system is currently configured to use. However, there are alternative packages listed that could replace it.

To resolve this issue, you can try installing one of the alternative packages. In this case, it looks like 'python3-apt' is a suitable replacement. Modify your installation command to use 'python3-apt' instead:

try this bash command : sudo apt-get install --no-install-recommends python3-apt -y -q

This should install the necessary package and resolve the "Package 'python-apt' has no installation candidate" error.