Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to know how many binary and source packages Red Hat provides with their current RHEL 6.4 Release.

share|improve this question
if you're a subscriber, maybe you can just enable update and source repositories and execute yum list > package-list.txt, then count lines of the file? – LiuYan 刘研 Mar 1 '13 at 12:11
If not, look at the package list for CentOS. But remember that CentOS doesn't have separate "server" and "workstation" setups, all packages are in the same repository. In any case, raw number of packages is meaningless, what you should look at is if what you need is available (and also what you reasonably might need in the future). – vonbrand Mar 1 '13 at 13:00
@vonbrand: sure, the raw package number is not really important. I just need it for some statistics. – tlo Mar 1 '13 at 15:13
@LiuYan刘研: Yeah, thought about that one, too. Probably the best way. For source packages I think I found a solution with some shell/perl magic: wget -q -O - http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/ | grep 'src.rpm' | perl -p -e 's,.*href="([a-zA-Z0-9-_.+]+?)-[0-9].*".*,$1,' | sort -u | wc -l – tlo Mar 1 '13 at 15:16
Alan Robertson once said: "There are lies, dammed lies and there is statistics". What statistics are these? This question does not make any sense to me... – Nils Mar 2 '13 at 21:26
up vote 2 down vote accepted

For the record, there is no easy way to get the number of packages in RHEL. As Nils and vonbrand pointed out, it is important to say, that it does not say anything about the distribution and that there are a lot of additional channels/repos in RHEL.

Nevertheless, to answer the orignal question, this is what I came up with (run on a RHEL 6.4 system):

  • Binary packages:

    yum list | egrep "(rhel-x86_64-server-6|RedHatEnterpriseLinux)" | wc -l

    --> 3742 packages

  • Source packages:

    wget -q -O - http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/ | grep 'src.rpm' | perl -p -e 's,.*href="([a-zA-Z0-9-_.+]+?)-[0-9].*".*,$1,' | sort -u | wc -l

    --> 2187 packages

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.