Updated: 11 October 2026 · Applies to: Ubuntu 24.04 LTS (apt 2.8.3, software-properties 0.99.49.4) and Ubuntu 26.04 LTS (apt 3.2.0, software-properties 0.120.1), every command tested on both; the older sources.list format checked on Ubuntu 22.04 (apt 2.4.14)
Ubuntu installs software from repositories (also called software sources or repos) listed in /etc/apt/sources.list.d/. On Ubuntu 24.04 and 26.04 the main list is /etc/apt/sources.list.d/ubuntu.sources, in the deb822 format; /etc/apt/sources.list only holds a comment pointing there. To see which repositories your server uses, run apt-cache policy. To remove one, run sudo add-apt-repository --remove ppa:OWNER/NAME for a PPA, or delete its .sources or .list file, then sudo apt update.
List the repositories on your system
apt-cache policy | grep http ls /etc/apt/sources.list.d/ grep -v '^#' /etc/apt/sources.list.d/ubuntu.sources
apt-cache policy shows every repository apt really reads, with its priority. Part of the output on our 24.04 server:
500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages 100 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 Packages 500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages 500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
Backports have priority 100 and the rest 500, so apt prefers the versions from the release and its updates. add-apt-repository -L also lists the configured entries (on 24.04 it prints the comments of ubuntu.sources too). On Ubuntu Desktop, the same list is in the Software & Updates app (“Configure the sources for installable software and updates”).
The default Ubuntu repositories and their URLs
A fresh Ubuntu 24.04 ubuntu.sources has two blocks: the archive and the security mirror.
Types: deb URIs: http://archive.ubuntu.com/ubuntu/ Suites: noble noble-updates noble-backports Components: main universe restricted multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg Types: deb URIs: http://security.ubuntu.com/ubuntu/ Suites: noble-security Components: main universe restricted multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Ubuntu 26.04 is the same with resolute instead of noble. The pieces:
- Suites (release codename plus pocket): 26.04 is
resolute, 24.04noble, 22.04jammy, 20.04focal. The pockets are the release itself,-updates,-securityand-backports. - Components:
mainis the base system;restrictedis software that may not be under a free licence;universeis community maintained;multiverseis community maintained software that may not be free and that, according to the comments inubuntu.sources, gets no review or updates from the Ubuntu security team. - Mirrors:
http://archive.ubuntu.com/ubuntu/(main archive),http://security.ubuntu.com/ubuntu/(security updates),http://ports.ubuntu.com/ubuntu-ports/(other architectures: in our check, arm64 packages for 24.04 were only on ports, while 26.04 had them on both) andhttp://old-releases.ubuntu.com/ubuntu/for end-of-life releases. When we checked, 23.04, 23.10 and 24.10 had moved to old-releases; 25.04 and 25.10 were still on the main archive.
Ubuntu 22.04 and older use the one-line format in /etc/apt/sources.list. The first lines on 22.04:
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted
A release upgrade rewrites these names for you (see how to upgrade Ubuntu to 26.04). To use a local mirror or a cache instead, see local mirror or apt-cacher-ng.
Enable universe or multiverse
If apt install says a package has no installation candidate, its component may be missing from the Components: lines. On Ubuntu 26.04 this works:
sudo add-apt-repository universe
On Ubuntu 24.04 our test printed Adding component(s) 'universe' to all repositories. but left ubuntu.sources unchanged (rechecked with software-properties 0.99.49.4), so check the result and edit the file if needed:
grep ^Components /etc/apt/sources.list.d/ubuntu.sources sudo nano /etc/apt/sources.list.d/ubuntu.sources # add universe to both Components lines sudo apt update
What is a PPA, and how to add one
A PPA (Personal Package Archive) is a repository on Launchpad where a person or team publishes packages, often newer versions of one program. For example, the Git maintainers’ PPA:
sudo apt install software-properties-common sudo add-apt-repository ppa:git-core/ppa sudo apt update apt-cache policy git
The PPA is saved as /etc/apt/sources.list.d/git-core-ubuntu-ppa-noble.sources (-resolute on 26.04) with its signing key inside. In our test apt-cache policy git then offered 1:2.55.0-0ppa1~ubuntu24.04.2 from the PPA instead of Ubuntu’s 1:2.43.0-1ubuntu7.3 (on 26.04: 1:2.55.0-0ppa1~ubuntu26.04.2 instead of 1:2.53.0-1ubuntu1). Only add PPAs you trust: they can replace any package on the system.
Add a third-party repository with its key
Vendors such as nginx.org publish their own repositories. Store the vendor key in /usr/share/keyrings/ and point to it with Signed-By, so it only applies to that repository:
sudo apt install curl gpg ca-certificates lsb-release curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg sudo tee /etc/apt/sources.list.d/nginx.sources <<EOF Types: deb URIs: https://nginx.org/packages/ubuntu Suites: $(lsb_release -cs) Components: nginx Signed-By: /usr/share/keyrings/nginx-archive-keyring.gpg EOF sudo apt update apt-cache policy nginx
The candidate became 1.30.5-1~noble on 24.04 and 1.30.5-1~resolute on 26.04. Before installing, compare the key fingerprints with the ones the vendor publishes:
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
Remove a repository or PPA
- A PPA:
sudo add-apt-repository --remove ppa:git-core/ppa
It printedRemoving repository.andRemoving entry from /etc/apt/sources.list.d/git-core-ubuntu-ppa-noble.sources, and the file was gone. - A PPA and its packages: removing a repository does not downgrade what you installed from it. To go back to Ubuntu’s own versions, use
ppa-purge(in universe):sudo apt install ppa-purge sudo ppa-purge ppa:git-core/ppa
In our tests it listedgitandgit-manunderThe following packages will be DOWNGRADED:, ended withPPA purged successfullyand returned git to Ubuntu’s version. It disables the PPA by addingEnabled: noto its file rather than deleting it; on 24.04 adding the same PPA again did not re-enable it, so delete the leftover file:sudo rm /etc/apt/sources.list.d/git-core-ubuntu-ppa-*.sources. - Any other repository: delete its file and, if nothing else uses it, its key:
sudo rm /etc/apt/sources.list.d/nginx.sources sudo rm /usr/share/keyrings/nginx-archive-keyring.gpg sudo apt update
Common apt update errors
NO_PUBKEY 2FD21310B49F6B46withThe repository is not updated and the previous index files will be used: the key is missing orSigned-Bypoints to the wrong file. apt 3.2 on 26.04 addsOpenPGP signature verification failedto the same warning.E: The repository '... Release' does not have a Release file.: wrong URL or wrong release name inSuites, often a repository that has no build for your Ubuntu version yet.W: Target Packages (...) is configured multiple times: the same repository is listed twice, often in an old.listfile and a.sourcesfile. Delete one.
On Ubuntu 26.04, sudo apt modernize-sources converts old .list files to .sources files and keeps a .list.bak copy (our test: - Writing /etc/apt/sources.list.d/nginx.sources). Ubuntu 24.04’s apt 2.8 does not have it (E: Invalid operation modernize-sources).
Search for a package in the repositories
apt search NAME searches the repositories you have enabled, and apt-cache policy NAME shows which repository and version each package comes from. Both are covered in how to list available packages with APT.
Related: Docker’s official repository on Ubuntu, install a specific package version and update all packages safely.
Official documentation: sources.list(5) manual (Ubuntu).
Ucartz services for this topic
- KVM VPS hosting: NVMe SSD and full root access, with Free Basic Managed Support.
- Unmanaged dedicated servers: full root access and free IPMI KVM, with Free Basic Managed Support.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
