Ubuntu – How to get a complete list of non-standard repositories in use

command linerepositorysupport

While doing some support audits I'd like to know what would be the most efficient/compact way to get a list of all extra reporitories being used on a given Ubuntu workstation using command line (not via the GUI tools). So far I am using:

  • diff'ing a standard sources.list file against the workstation's
  • examining files under cat /etc/apt/sources.list.d

Any other ideas on how to best go about this ?

Best Answer

To examine the files under /etc/apt/sources.list.d, you could use:

cat /etc/apt/sources.list.d/*.list | grep -v "^#"

This reads out the contents of all the files there and then cuts out all commented out lines. This way you only get the repositories that are actually in use.