Malformed entry 11 in list file /etc/apt/sources.list (URI parse)

I deployed a ubuntu server. Then tried to install certain packages but this results in:

sudo: unable to resolve host production-server-1
E: Malformed entry 11 in list file /etc/apt/sources.list (URI parse)
E: The list of sources could not be read.

This is what sources.list looks like:

## 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 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

How can I solve this problem.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there,

It looks like that the following line is line 11:

deb {{mirror}} {{codename}} main restricted

Have you made any changes to the source list file after the server setup? The line should not really hold any variables but an actual link to the repository.

What I could suggest is taking a default copy of the source list file from the exact Ubuntu version that you are currently using and replacing it.

Let me know how it goes. Regards, Bobby