Introduction
When managing software on Ubuntu, you may find it important to know which repositories are currently configured for use on the server. This guide explains how to review the repositories that are currently configured for use.
Procedure
On newer versions of Ubuntu, you would be able to use the following command to list repositories:
add-apt-repository --list
However, cPanel is currently only available on the LTS version of Ubuntu: 20.04
On Ubuntu 20.04, you must examine the source file to review the currently configured repositories:
/etc/apt/sources.list
You can learn more about how to interpret this configuration file with the following resource:
https://help.ubuntu.com/community/Repositories/CommandLine
Alternatively, you could use a script to parse and display the configuration file for you. One example is the following script:
apt update > /dev/null 2>&1 && sudo apt-cache policy | grep http | awk '{print $2 $3}' | sort -u
Here is some example output:
# apt update > /dev/null 2>&1 && sudo apt-cache policy | grep http | awk '{print $2 $3}' | sort -u
http://ap-mumbai-1-ad-1.clouds.archive.ubuntu.com/ubuntufocal-backports/main
http://ap-mumbai-1-ad-1.clouds.archive.ubuntu.com/ubuntufocal-backports/universe
http://ap-mumbai-1-ad-1.clouds.archive.ubuntu.com/ubuntufocal/main
http://ap-mumbai-1-ad-1.clouds.archive.ubuntu.com/ubuntufocal/multiverse
http://ap-mumbai-1-ad-1.clouds.archive.ubuntu.com/ubuntufocal/restricted
http://ap-mumbai-1-ad-1.clouds.archive.ubuntu.com/ubuntufocal/universe
http://ap-mumbai-1-ad-1.clouds.archive.ubuntu.com/ubuntufocal-updates/main
http://ap-mumbai-1-ad-1.clouds.archive.ubuntu.com/ubuntufocal-updates/multiverse
http://ap-mumbai-1-ad-1.clouds.archive.ubuntu.com/ubuntufocal-updates/restricted
http://ap-mumbai-1-ad-1.clouds.archive.ubuntu.com/ubuntufocal-updates/universe
http://repo.mysql.com/apt/ubuntufocal/mysql-8.0
http://repo.mysql.com/apt/ubuntufocal/mysql-apt-config
http://repo.mysql.com/apt/ubuntufocal/mysql-tools
http://security.ubuntu.com/ubuntufocal-security/main
http://security.ubuntu.com/ubuntufocal-security/multiverse
http://security.ubuntu.com/ubuntufocal-security/restricted
http://security.ubuntu.com/ubuntufocal-security/universe
httpupdate.cpanel.net
mirror://httpupdate.cpanel.net/ea4-u20-mirrorlist./
Ultimately, it is still important that you review the documentation and understand how to examine the /etc/apt/sources.list file directly. The above script may not properly display the repository information in the way that you need to resolve the issue you are working on.
Comments
0 comments
Article is closed for comments.