Search code examples
google-cloud-platformvirtual-machineapt-gettpugoogle-cloud-tpu

Malformed entry 11 in list file /etc/apt/sources.list on fresh TPU VM on GCP


I created a TPU VM on GCP.

I logged in via ssh and want to install some software. But I get the following error:

$ sudo apt-get update
E: Malformed entry 11 in list file /etc/apt/sources.list (URI parse)
E: The list of sources could not be read.

The /etc/apt/sources.list file looks like this:

## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
##     or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb {{mirror}} {{codename}} main restricted
# deb-src {{mirror}} {{codename}} main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb {{mirror}} {{codename}}-updates main restricted
# deb-src {{mirror}} {{codename}}-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb {{mirror}} {{codename}} universe
# deb-src {{mirror}} {{codename}} universe
deb {{mirror}} {{codename}}-updates universe
# deb-src {{mirror}} {{codename}}-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
[...]

What do I need to do to solve this?


Solution

  • This issue has been fixed. Looks like you might be using the older version of the TPU VM image.

    Two approaches -

    1. If you still want to use your old VM, you can patch it with the following command - sed -i 's+{{mirror}}+http://us-central1.gce.archive.ubuntu.com/ubuntu/+g;s+{{codename}}+focal+g;s+{{security}}+http://security.ubuntu.com/ubuntu+g' /etc/apt/sources.list

    2. Otherwise delete and recreate a new TPU VM that will fetch the latest image.