How to list packages in specific yum repository

List packages in specific yum repository.

Operating system.

$ cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)

Display enabled repositories.

$ yum repolist enabled
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.hitme.net.pl
 * extras: mirror-pl.kielcetechnologypark.net
 * updates: mirror-pl.kielcetechnologypark.net
repo id                                                                               repo name                                                                              status
base/7/x86_64                                                                         CentOS-7 - Base                                                                        10097
extras/7/x86_64                                                                       CentOS-7 - Extras                                                                        304
google-cloud-compute                                                                  Google Cloud Compute                                                                      11
google-cloud-sdk                                                                      Google Cloud SDK                                                                         906
updates/7/x86_64                                                                      CentOS-7 - Updates                                                                       311
repolist: 11629

Display distinct packages in google-cloud-sdk repository.

$ yum --disablerepo="*"  --enablerepo="google-cloud-sdk" list available
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
google-cloud-sdk.noarch                                                                              263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-app-engine-go.x86_64                                                                263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-app-engine-grpc.x86_64                                                              263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-app-engine-java.noarch                                                              263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-app-engine-python.noarch                                                            263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-app-engine-python-extras.noarch                                                     263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-bigtable-emulator.x86_64                                                            263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-cbt.x86_64                                                                          263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-cloud-build-local.x86_64                                                            263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-datalab.noarch                                                                      263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-datastore-emulator.noarch                                                           263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-firestore-emulator.noarch                                                           263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-pubsub-emulator.noarch                                                              263.0.0-1                                                     google-cloud-sdk
google-cloud-sdk-tests.noarch                                                                        263.0.0-1                                                     google-cloud-sdk
kubectl.x86_64                                                                                       1.15.3-0                                                      google-cloud-sdk

Display all packages in google-cloud-sdk repository.

$ yum --disablerepo="*" --showduplicates --enablerepo="google-cloud-sdk" list available
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
google-cloud-sdk.noarch                                                                            195.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk.noarch                                                                            196.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk.noarch                                                                            197.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk.noarch                                                                            198.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk.noarch                                                                            199.0.0-1.el7                                                   google-cloud-sdk
[...]
google-cloud-sdk.noarch                                                                            259.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk.noarch                                                                            260.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk.noarch                                                                            261.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk.noarch                                                                            262.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk.noarch                                                                            263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-go.x86_64                                                              195.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-go.x86_64                                                              196.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-go.x86_64                                                              197.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-go.x86_64                                                              198.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-go.x86_64                                                              199.0.0-1                                                       google-cloud-sdk
[...]
google-cloud-sdk-app-engine-go.x86_64                                                              259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-go.x86_64                                                              260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-go.x86_64                                                              261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-go.x86_64                                                              262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-go.x86_64                                                              263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-grpc.x86_64                                                            201.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-grpc.x86_64                                                            202.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-grpc.x86_64                                                            203.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-grpc.x86_64                                                            204.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-grpc.x86_64                                                            206.0.0-1                                                       google-cloud-sdk
[...]
google-cloud-sdk-app-engine-java.noarch                                                            259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-java.noarch                                                            260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-java.noarch                                                            261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-java.noarch                                                            262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-java.noarch                                                            263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python.noarch                                                          195.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python.noarch                                                          196.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python.noarch                                                          197.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python.noarch                                                          198.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python.noarch                                                          199.0.0-1                                                       google-cloud-sdk
[...]
google-cloud-sdk-app-engine-python.noarch                                                          259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python.noarch                                                          260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python.noarch                                                          261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python.noarch                                                          262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python.noarch                                                          263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python-extras.noarch                                                   195.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python-extras.noarch                                                   196.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python-extras.noarch                                                   197.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python-extras.noarch                                                   198.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python-extras.noarch                                                   199.0.0-1                                                       google-cloud-sdk
[...]
google-cloud-sdk-app-engine-python-extras.noarch                                                   259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python-extras.noarch                                                   260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python-extras.noarch                                                   261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python-extras.noarch                                                   262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-app-engine-python-extras.noarch                                                   263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-bigtable-emulator.x86_64                                                          195.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-bigtable-emulator.x86_64                                                          196.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-bigtable-emulator.x86_64                                                          197.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-bigtable-emulator.x86_64                                                          198.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-bigtable-emulator.x86_64                                                          199.0.0-1                                                       google-cloud-sdk
[...]
google-cloud-sdk-bigtable-emulator.x86_64                                                          259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-bigtable-emulator.x86_64                                                          260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-bigtable-emulator.x86_64                                                          261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-bigtable-emulator.x86_64                                                          262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-bigtable-emulator.x86_64                                                          263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cbt.x86_64                                                                        195.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cbt.x86_64                                                                        196.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cbt.x86_64                                                                        197.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cbt.x86_64                                                                        198.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cbt.x86_64                                                                        199.0.0-1                                                       google-cloud-sdk
[...]
google-cloud-sdk-cbt.x86_64                                                                        259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cbt.x86_64                                                                        260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cbt.x86_64                                                                        261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cbt.x86_64                                                                        262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cbt.x86_64                                                                        263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cloud-build-local.x86_64                                                          210.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cloud-build-local.x86_64                                                          211.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cloud-build-local.x86_64                                                          212.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cloud-build-local.x86_64                                                          213.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cloud-build-local.x86_64                                                          214.0.0-1                                                       google-cloud-sdk
[...]
google-cloud-sdk-cloud-build-local.x86_64                                                          259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cloud-build-local.x86_64                                                          260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cloud-build-local.x86_64                                                          261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cloud-build-local.x86_64                                                          262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-cloud-build-local.x86_64                                                          263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datalab.noarch                                                                    195.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datalab.noarch                                                                    196.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datalab.noarch                                                                    197.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datalab.noarch                                                                    198.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datalab.noarch                                                                    199.0.0-1                                                       google-cloud-sdk
[...]
google-cloud-sdk-datalab.noarch                                                                    259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datalab.noarch                                                                    260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datalab.noarch                                                                    261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datalab.noarch                                                                    262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datalab.noarch                                                                    263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datastore-emulator.noarch                                                         195.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datastore-emulator.noarch                                                         196.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datastore-emulator.noarch                                                         197.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datastore-emulator.noarch                                                         198.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datastore-emulator.noarch                                                         199.0.0-1                                                       google-cloud-sdk
[...]
google-cloud-sdk-datastore-emulator.noarch                                                         259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datastore-emulator.noarch                                                         260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datastore-emulator.noarch                                                         261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datastore-emulator.noarch                                                         262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-datastore-emulator.noarch                                                         263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-firestore-emulator.noarch                                                         258.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-firestore-emulator.noarch                                                         259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-firestore-emulator.noarch                                                         260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-firestore-emulator.noarch                                                         261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-firestore-emulator.noarch                                                         262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-firestore-emulator.noarch                                                         263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-pubsub-emulator.noarch                                                            195.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-pubsub-emulator.noarch                                                            196.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-pubsub-emulator.noarch                                                            197.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-pubsub-emulator.noarch                                                            198.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-pubsub-emulator.noarch                                                            199.0.0-1                                                       google-cloud-sdk
[...]
google-cloud-sdk-pubsub-emulator.noarch                                                            259.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-pubsub-emulator.noarch                                                            260.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-pubsub-emulator.noarch                                                            261.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-pubsub-emulator.noarch                                                            262.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-pubsub-emulator.noarch                                                            263.0.0-1                                                       google-cloud-sdk
google-cloud-sdk-tests.noarch                                                                      183.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk-tests.noarch                                                                      184.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk-tests.noarch                                                                      185.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk-tests.noarch                                                                      186.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk-tests.noarch                                                                      187.0.0-1.el7                                                   google-cloud-sdk
[...]
google-cloud-sdk-tests.noarch                                                                      259.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk-tests.noarch                                                                      260.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk-tests.noarch                                                                      261.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk-tests.noarch                                                                      262.0.0-1.el7                                                   google-cloud-sdk
google-cloud-sdk-tests.noarch                                                                      263.0.0-1                                                       google-cloud-sdk
kubectl.x86_64                                                                                     1.15.3-0                                                        google-cloud-sdk

There are 906 packages defined in this repository, but only 15 distinct ones.