Table of Contents

Ubuntu - apt - List all repositories and PPAs

apt repositories are found in /etc/apt/sources.list and /etc/apt/sources.list.d.


Using grep

grep ^[^#] /etc/apt/sources.list /etc/apt/sources.list.d/*
 
or
 
grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/*

NOTE: The top option removes comments from the output.


Using add-apt-repository

add-apt-repository --list

returns:

deb http://je.archive.ubuntu.com/ubuntu/ jammy restricted main universe multiverse
deb http://je.archive.ubuntu.com/ubuntu/ jammy-updates restricted main universe multiverse
deb http://je.archive.ubuntu.com/ubuntu/ jammy-backports restricted main universe multiverse
deb http://security.ubuntu.com/ubuntu jammy-security restricted main universe multiverse
deb https://repo.radeon.com/amdgpu/5.4.6/ubuntu jammy main
deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.4.6 jammy main
deb https://ppa.launchpadcontent.net/kisak/kisak-mesa/ubuntu/ jammy main

Using apt-cache

apt-cache policy | grep http | awk '{print $2" "$3}' | sort -u

returns:

http://je.archive.ubuntu.com/ubuntu jammy-backports/main
http://je.archive.ubuntu.com/ubuntu jammy-backports/universe
http://je.archive.ubuntu.com/ubuntu jammy/main
http://je.archive.ubuntu.com/ubuntu jammy/multiverse
http://je.archive.ubuntu.com/ubuntu jammy/restricted
http://je.archive.ubuntu.com/ubuntu jammy/universe
http://je.archive.ubuntu.com/ubuntu jammy-updates/main
http://je.archive.ubuntu.com/ubuntu jammy-updates/multiverse
http://je.archive.ubuntu.com/ubuntu jammy-updates/restricted
http://je.archive.ubuntu.com/ubuntu jammy-updates/universe
http://security.ubuntu.com/ubuntu jammy-security/main
http://security.ubuntu.com/ubuntu jammy-security/multiverse
http://security.ubuntu.com/ubuntu jammy-security/restricted
http://security.ubuntu.com/ubuntu jammy-security/universe
https://ppa.launchpadcontent.net/kisak/kisak-mesa/ubuntu jammy/main
https://repo.radeon.com/amdgpu/5.4.6/ubuntu jammy/main
https://repo.radeon.com/rocm/apt/5.4.6 jammy/main

NOTE: apt-cache policy will only show the repos after you have run apt update.

  • If a repo has been added with add-apt-repository, it will not show up with apt-cache policy until apt update is run.