Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list the configured repositories?

Tags:

How can I list all the repositories configured for a project?

Background: I have a pretty complex gradle build script and cannot get my NetBeans to download the sources for maven dependencies. In that issue-report I was suggested to double check the order in which mavenCentral is being imported.

like image 224
Alberto Avatar asked Aug 21 '15 14:08

Alberto


People also ask

How do I list all currently enabled repositories?

You need to pass the repolist option to the yum command. This option will show you a list of configured repositories under RHEL / Fedora / SL / CentOS Linux. The default is to list all enabled repositories. Pass -v (verbose mode) optionn for more information is listed.

How do I list a repository in Linux?

For Debian systems such as Ubuntu, you could use a command like the one shown below to list the repositories that are used when you update your system. This command selects sources from the /etc/apt/sources. list file and /etc/apt/sources. list.

How do I find out what repository is installed?

You can use yum -v search that would show you packages along with repo it is present in. If you also add --showduplicates you will see all versions of that package.

How do I list a repository package?

If you want to list all the packages in a repository on your desktop, you can use Synaptic Package Manager. Synaptic is a graphical package management application for APT (APT being the main command line package manager for Debian and its derivatives).


1 Answers

For anyone interested, here is the code to list the loaded repositories (thanks @kelemen):

task listrepos {     doLast {         println "Repositories:"         project.repositories.each { println "Name: " + it.name + "; url: " + it.url }    } } 

After adding this code to the build script, execute gradle listrepos and voilà...

like image 108
Alberto Avatar answered Oct 14 '22 17:10

Alberto