How to list packages of specific repository synced on Red Hat Satellite 6 server using command line

Solution Verified - Updated

Environment

  • Red Hat Satellite 6

Issue

  • How to list packages of specific repository synced on Red Hat Satellite 6 server using command line.
  • Hammer command to list packages from specific repository.

Resolution

  • List the repositories synced on the Red Hat Satellite 6 server.

    # hammer repository list --with-content 'rpm'
    
  • Use the following command to list the packages provided by the repository.

    # hammer package list --repository-id <REPOSITORY ID>
    
  • To export the out to a CSV file:

    # hammer --csv --output-file package_list.csv package list --repository-id <REPOSITORY ID>
    
  • From the client CLI, it is possible to get the packages list as mentioned in the below article.
    How to find list of packages available from a specific repository?

For more KB articles/solutions related to Red Hat Satellite 6.x Repository Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Repository Issues.

Diagnostic Steps

  • Output of the command from the Resolution section.

    
        # hammer repository list
    
    ID | NAME                                                                        | PRODUCT                                                       | CONTENT TYPE | URL                                                                             

-|-|-|-|-
1 | Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server | Red Hat Enterprise Linux Server | yum | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os

    2  | Red Hat Satellite Tools 6.8 for RHEL 7 Server RPMs x86_64                   | Red Hat Enterprise Linux Server                               | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6....                  

-|-|-|-|-

    # hammer package list --repository-id 2
    ID    | FILENAME                                                                    | SOURCE RPM

-|-|-
55164 | foreman-cli-2.1.2.19-1.el7sat.noarch.rpm | foreman-2.1.2.19-1.el7sat.src.rpm
55158 | foreman-cli-2.1.2.24-1.el7sat.noarch.rpm | foreman-2.1.2.24-1.el7sat.src.rpm
55153 | gofer-2.12.5-7.el7sat.noarch.rpm | gofer-2.12.5-7.el7sat.src.rpm
55147 | katello-agent-3.5.4-1.el7sat.noarch.rpm | katello-host-tools-3.5.4-1.el7sat.src.rpm
55141 | katello-host-tools-3.5.4-1.el7sat.noarch.rpm | katello-host-tools-3.5.4-1.el7sat.src.rpm
55135 | katello-host-tools-fact-plugin-3.5.4-1.el7sat.noarch.rpm | katello-host-tools-3.5.4-1.el7sat.src.rpm
55114 | katello-host-tools-tracer-3.5.4-1.el7sat.noarch.rpm | katello-host-tools-3.5.4-1.el7sat.src.rpm
55111 | pulp-puppet-tools-2.21.3-2.el7sat.noarch.rpm | pulp-puppet-2.21.3-2.el7sat.src.rpm
55150 | puppet-agent-6.14.0-2.el7sat.x86_64.rpm | puppet-agent-6.14.0-2.el7sat.src.rpm
55137 | python2-beautifulsoup4-4.6.3-2.el7sat.noarch.rpm | python-beautifulsoup4-4.6.3-2.el7sat.src.rpm
55163 | python2-future-0.16.0-11.el7sat.noarch.rpm | future-0.16.0-11.el7sat.src.rpm
55113 | python2-isodate-0.5.4-12.el7sat.noarch.rpm | python-isodate-0.5.4-12.el7sat.src.rpm
55159 | python2-tracer-0.7.3-1.el7sat.noarch.rpm | tracer-0.7.3-1.el7sat.src.rpm
55151 | python-argcomplete-1.7.0-2.el7sat.noarch.rpm | python-argcomplete-1.7.0-2.el7sat.src.rpm
55116 | python-gofer-2.12.5-7.el7sat.noarch.rpm | gofer-2.12.5-7.el7sat.src.rpm
55143 | python-gofer-proton-2.12.5-7.el7sat.noarch.rpm | gofer-2.12.5-7.el7sat.src.rpm
55161 | python-psutil-5.0.1-3.el7sat.x86_64.rpm | python-psutil-5.0.1-3.el7sat.src.rpm
55120 | python-pulp-common-2.21.3-1.el7sat.noarch.rpm | pulp-2.21.3-1.el7sat.src.rpm
55144 | python-pulp-manifest-2.21.3-2.el7sat.noarch.rpm | pulp-rpm-2.21.3-2.el7sat.src.rpm
55112 | python-pulp-puppet-common-2.21.3-2.el7sat.noarch.rpm | pulp-puppet-2.21.3-2.el7sat.src.rpm
55154 | python-qpid-proton-0.28.0-3.el7.x86_64.rpm | qpid-proton-0.28.0-3.el7.src.rpm
55122 | qpid-proton-c-0.28.0-3.el7.x86_64.rpm | qpid-proton-0.28.0-3.el7.src.rpm
55160 | rubygem-foreman_scap_client-0.4.6-1.el7sat.noarch.rpm | rubygem-foreman_scap_client-0.4.6-1.el7sat.src.rpm
55142 | satellite-cli-6.8.0-1.el7sat.noarch.rpm | satellite-6.8.0-1.el7sat.src.rpm
55171 | satellite-cli-6.8.3-1.el7sat.noarch.rpm | satellite-6.8.3-1.el7sat.src.rpm
55156 | tfm-rubygem-amazing_print-1.1.0-1.el7sat.noarch.rpm | tfm-rubygem-amazing_print-1.1.0-1.el7sat.src.rpm
55174 | tfm-rubygem-apipie-bindings-0.3.0-1.el7sat.noarch.rpm | tfm-rubygem-apipie-bindings-0.3.0-1.el7sat.src.rpm
55172 | tfm-rubygem-clamp-1.1.2-5.el7sat.noarch.rpm | tfm-rubygem-clamp-1.1.2-5.el7sat.src.rpm
55118 | tfm-rubygem-domain_name-0.5.20160310-4.el7sat.noarch.rpm | tfm-rubygem-domain_name-0.5.20160310-4.el7sat.src.rpm
55165 | tfm-rubygem-fast_gettext-1.4.1-3.el7sat.noarch.rpm | tfm-rubygem-fast_gettext-1.4.1-3.el7sat.src.rpm
55167 | tfm-rubygem-gettext-3.1.4-10.el7sat.noarch.rpm | tfm-rubygem-gettext-3.1.4-10.el7sat.src.rpm
55132 | tfm-rubygem-hammer_cli-2.1.2-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli-2.1.2-1.el7sat.src.rpm
55136 | tfm-rubygem-hammer_cli_foreman-2.1.2.1-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman-2.1.2.1-1.el7sat.src.rpm
55166 | tfm-rubygem-hammer_cli_foreman-2.1.2.2-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman-2.1.2.2-1.el7sat.src.rpm
55169 | tfm-rubygem-hammer_cli_foreman_admin-0.0.9-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_admin-0.0.9-1.el7sat.src.rpm
55162 | tfm-rubygem-hammer_cli_foreman_ansible-0.3.2-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_ansible-0.3.2-1.el7sat.src.rpm
55134 | tfm-rubygem-hammer_cli_foreman_azure_rm-0.2.0-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_azure_rm-0.2.0-1.el7sat.src.rpm
55152 | tfm-rubygem-hammer_cli_foreman_bootdisk-0.3.0-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_bootdisk-0.3.0-1.el7sat.src.rpm
55146 | tfm-rubygem-hammer_cli_foreman_discovery-1.0.2-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_discovery-1.0.2-1.el7sat.src.rpm
55149 | tfm-rubygem-hammer_cli_foreman_docker-0.0.6.4-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_docker-0.0.6.4-1.el7sat.src.rpm
55124 | tfm-rubygem-hammer_cli_foreman_openscap-0.1.11-1.fm2_1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_openscap-0.1.11-1.fm2_1.el7sat.src.rpm
55157 | tfm-rubygem-hammer_cli_foreman_remote_execution-0.1.2-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_remote_execution-0.1.2-1.el7sat.src.rpm
55121 | tfm-rubygem-hammer_cli_foreman_tasks-0.0.14-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_tasks-0.0.14-1.el7sat.src.rpm
55139 | tfm-rubygem-hammer_cli_foreman_templates-0.2.0-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_templates-0.2.0-1.el7sat.src.rpm
55115 | tfm-rubygem-hammer_cli_foreman_virt_who_configure-0.0.6-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_foreman_virt_who_configure-0.0.6-1.el7sat.src.rpm
55170 | tfm-rubygem-hammer_cli_katello-0.22.2.2-1.el7sat.noarch.rpm | tfm-rubygem-hammer_cli_katello-0.22.2.2-1.el7sat.src.rpm
55133 | tfm-rubygem-hashie-3.6.0-1.el7sat.noarch.rpm | tfm-rubygem-hashie-3.6.0-1.el7sat.src.rpm
55145 | tfm-rubygem-highline-1.7.8-4.el7sat.noarch.rpm | tfm-rubygem-highline-1.7.8-4.el7sat.src.rpm
55127 | tfm-rubygem-http-cookie-1.0.2-5.el7sat.noarch.rpm | tfm-rubygem-http-cookie-1.0.2-5.el7sat.src.rpm
55130 | tfm-rubygem-jwt-2.2.1-1.el7sat.noarch.rpm | tfm-rubygem-jwt-2.2.1-1.el7sat.src.rpm
55168 | tfm-rubygem-little-plugger-1.1.4-1.el7sat.noarch.rpm | tfm-rubygem-little-plugger-1.1.4-1.el7sat.src.rpm
55123 | tfm-rubygem-locale-2.0.9-13.el7sat.noarch.rpm | tfm-rubygem-locale-2.0.9-13.el7sat.src.rpm
55119 | tfm-rubygem-logging-2.2.2-6.el7sat.noarch.rpm | tfm-rubygem-logging-2.2.2-6.el7sat.src.rpm
55129 | tfm-rubygem-mime-types-3.2.2-4.el7sat.noarch.rpm | tfm-rubygem-mime-types-3.2.2-4.el7sat.src.rpm
55176 | tfm-rubygem-mime-types-data-3.2018.0812-4.el7sat.noarch.rpm | tfm-rubygem-mime-types-data-3.2018.0812-4.el7sat.src.rpm
55125 | tfm-rubygem-multi_json-1.14.1-1.el7sat.noarch.rpm | tfm-rubygem-multi_json-1.14.1-1.el7sat.src.rpm
55126 | tfm-rubygem-netrc-0.11.0-3.el7sat.noarch.rpm | tfm-rubygem-netrc-0.11.0-3.el7sat.src.rpm
55131 | tfm-rubygem-oauth-0.5.4-3.el7sat.noarch.rpm | tfm-rubygem-oauth-0.5.4-3.el7sat.src.rpm
55155 | tfm-rubygem-powerbar-2.0.1-2.el7sat.noarch.rpm | tfm-rubygem-powerbar-2.0.1-2.el7sat.src.rpm
55138 | tfm-rubygem-rest-client-2.0.2-3.el7sat.noarch.rpm | tfm-rubygem-rest-client-2.0.2-3.el7sat.src.rpm
55110 | tfm-rubygem-text-1.3.0-7.el7sat.noarch.rpm | tfm-rubygem-text-1.3.0-7.el7sat.src.rpm
55173 | tfm-rubygem-unf-0.1.3-7.el7sat.noarch.rpm | tfm-rubygem-unf-0.1.3-7.el7sat.src.rpm
55148 | tfm-rubygem-unf_ext-0.0.7.2-1.el7sat.x86_64.rpm | tfm-rubygem-unf_ext-0.0.7.2-1.el7sat.src.rpm
55140 | tfm-rubygem-unicode-0.4.4.4-1.el7sat.x86_64.rpm | tfm-rubygem-unicode-0.4.4.4-1.el7sat.src.rpm
55117 | tfm-rubygem-unicode-display_width-1.0.5-5.el7sat.noarch.rpm | tfm-rubygem-unicode-display_width-1.0.5-5.el7sat.src.rpm
55128 | tfm-runtime-6.1-1.el7sat.x86_64.rpm | tfm-6.1-1.el7sat.src.rpm

    55175 | tracer-common-0.7.3-1.el7sat.noarch.rpm                                     | tracer-0.7.3-1.el7sat.src.rpm

-|-|-
```

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.