Software⏱️ 4 min read📅 2026-06-19

How to Fix: qemu apt-get error failed to fetch

QEMU apt-get error failed to fetch due to invalid repository URL. Update /etc/apt/sources.list and try again.

Quick Answer: Update /etc/apt/sources.list to point to the correct repository URL, then run apt-get update --fix-missing and apt-get install openssh-server.

The error 'qemu apt-get error failed to fetch' affects users who are running QEMU with a Linaro release and attempting to use SCP functionality. This issue is frustrating because it prevents users from updating their system or installing necessary packages, ultimately hindering the smooth operation of their virtual machine.

Despite configuring the network settings correctly, the error persists, causing inconvenience for those relying on SCP for file transfer. In this guide, we will explore the root causes and provide solutions to resolve this issue.

🔍 Why This Happens

  • The primary reason for this error is that QEMU uses a different package repository than Ubuntu's standard repositories. The 'ports' repository used by QEMU is not available in all versions of Linaro, leading to the 404 Not Found error.
  • Another possible cause is that the system clock may be set incorrectly, causing QEMU to use an outdated version of the package repository.

🔧 Proven Troubleshooting Steps

Configuring QEMU to use a different package repository

  1. Step 1: Step 1: Add the necessary configuration options to the QEMU command line. This can be done by adding the '-device virtio-net-pci,netdev=net0' option to the QEMU command. For example: 'qemu-system-arm -m 1024 -vnc :0 -netdev user,id=net0,hostfwd=tcp::10000-:22 -device virtio-net-pci,netdev=net0'. This sets up a virtual network interface for the QEMU system.
  2. Step 2: Step 2: Create a new file in the /etc/qemu/ directory with the following contents: netdev 'net0' { socket = '/var/run/net0.sock', }. This defines the netdev configuration for the virtual network interface.
  3. Step 3: Step 3: Restart QEMU to apply the changes. Run the command 'qemu-system-arm -m 1024 -vnc :0 -netdev user,id=net0,hostfwd=tcp::10000-:22 -device virtio-net-pci,netdev=net0' and then 'sudo service qemu-system restart' to ensure QEMU is restarted with the new configuration.

Updating the system clock

  1. Step 1: Step 1: Check the current system clock. Run the command 'date' to check the current date and time.
  2. Step 2: Step 2: Adjust the system clock if necessary. If the system clock is set incorrectly, you can use the 'timedatectl' command to adjust it. For example, run 'timedatectl set-timezone UTC' to set the timezone to UTC.
  3. Step 3: Step 3: Restart QEMU to apply the changes. Run the command 'qemu-system-arm -m 1024 -vnc :0 -netdev user,id=net0,hostfwd=tcp::10000-:22 -device virtio-net-pci,netdev=net0' and then 'sudo service qemu-system restart' to ensure QEMU is restarted with the updated system clock.

💡 Conclusion

To resolve the 'qemu apt-get error failed to fetch' issue, it is recommended to configure QEMU to use a different package repository or update the system clock. By following these steps, you should be able to successfully install necessary packages and update your system without encountering any issues with SCP functionality.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions