Given the contents of your sources.list file, there seems to be some redundancy in the entries. I will point out the duplicate lines; then, based on your posted content, I will provide a cleaner version of the sources.list file. You mentioned this file was written by cloud-init, so these changes might not persist if your cloud instance is re-bundled unless you make the adjustments noted in the file's header comments.
Here are the redundant lines:
deb http://c.archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse
deb http://c.archive.ubuntu.com/ubuntu/ jammy restricted main universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ jammy main universe restricted multiverse
Each of these lines essentially includes the same repositories (main, universe, restricted, multiverse) for the same Ubuntu release (jammy).
Here's a cleaned-up version of your sources.list without redundant entries:
## 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 http://c.archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://eu-paris-1-ad-1.clouds.ports.ubuntu.com/ubuntu-ports/ jammy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://c.archive.ubuntu.com/ubuntu/ jammy-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 http://c.archive.ubuntu.com/ubuntu/ jammy universe
deb http://c.archive.ubuntu.com/ubuntu/ jammy-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://c.archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://c.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://c.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted
# deb-src http://c.archive.ubuntu.com/ubuntu/ jammy-security restricted universe multiverse main
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe
# deb-src http://ports.ubuntu.com/ubuntu-ports jammy-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports jammy-security multiverse
You can copy this cleaned-up version into /etc/apt/sources.list. To do this, you can use a terminal text editor like nano:
sudo nano /etc/apt/sources.list
Paste the corrected content, save the file (with Ctrl + O in nano, followed by Enter), and exit the editor (with Ctrl + X).
Then, run:
sudo apt-get update
This will update the package lists using the new, deduplicated sources. Now you can proceed with installing or updating software as required. Remember that if your instance is reset by cloud-init, these changes may not persist unless modifications are made as described at the start of the sources.list file.