Take the 2-minute tour ×
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.

I get these messages when I run this command:

# yum install pcre pcre-devel php php-common php-gd php-cli php-mysql flex bison
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
No package pcre-devel available.
No package php available.
No package php-common available.
No package php-gd available.
No package php-cli available.
No package php-mysql available.
No package flex available.
No package bison available.
Nothing to do

How can I fix that?

share|improve this question
1  
Did you set up any repo? Can you show output of # yum repolist –  Shâu Shắc Jul 28 '13 at 10:57
    
What version of rhel, fedora, centos are you using? –  slm Jul 28 '13 at 12:40

1 Answer 1

Listing enabled repos

On a CentOS 6.x box I have the following repositories:

$ yum repolist|column
Loaded plugins: fastestmirror, priorities, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: mirrors.usinternet.com
 * epel: mirror.steadfast.net
 * extras: centos.mbni.med.umich.edu
 * updates: centos.mirrors.tds.net
76 packages excluded due to repository priority protections
repo id         repo name                                               status
base            CentOS-6 - Base                                         6,315+66
epel            Extra Packages for Enterprise Linux 6 - x86_64             9,349
extras          CentOS-6 - Extras                                            6+7
updates         CentOS-6 - Updates                                       1,020+3
repolist: 16,690

Which repository does package X come from?

On CentOS 6.x when I use the command repoquery I find the following packages are from these repositories:

$ for i in pcre pcre-devel php php-common php-gd php-cli php-mysql flex bison ; do 
  echo -n $i; repoquery -i --archlist=`uname -m` $i \
            | grep Repo | sed 's/Repository//'; 
done | column -t

Produces the following output:

pcre        :  base
pcre-devel  :  base
php         :  updates
php-common  :  updates
php-gd      :  updates
php-cli     :  updates
php-mysql   :  updates
flex        :  base
bison       :  base

List all available repos

You can see what repos are available for your box with this command:

$ yum repolist all
...
...
C6.3-contrib                   CentOS-6.3 - Contrib                                                      disabled
C6.3-extras                    CentOS-6.3 - Extras                                                       disabled
C6.3-updates                   CentOS-6.3 - Updates                                                      disabled
base                           CentOS-6 - Base                                                           enabled: 6,315+66
c6-media                       CentOS-6 - Media                                                          disabled
centosplus                     CentOS-6 - Plus                                                           disabled
contrib                        CentOS-6 - Contrib                                                        disabled
debug                          CentOS-6 - Debuginfo                                                      disabled
epel                           Extra Packages for Enterprise Linux 6 - x86_64                            enabled:    9,349
epel-debuginfo                 Extra Packages for Enterprise Linux 6 - x86_64 - Debug                    disabled
epel-source                    Extra Packages for Enterprise Linux 6 - x86_64 - Source                   disabled
epel-testing                   Extra Packages for Enterprise Linux 6 - Testing - x86_64                  disabled
epel-testing-debuginfo         Extra Packages for Enterprise Linux 6 - Testing - x86_64 - Debug          disabled
epel-testing-source            Extra Packages for Enterprise Linux 6 - Testing - x86_64 - Source         disabled
extras                         CentOS-6 - Extras                                                         enabled:      6+7
updates                        CentOS-6 - Updates                                                        enabled:  1,020+3
repolist: 16,690

Enabling a repo

To enable one of the disabled repos:

$ yum-config-manager --enablerepo=<reponame>

For example:

$ yum-config-manager --enablerepo=centosplus

Adding a repo

If you have a repositories .repo file you can add it and enable it like so:

$ yum-config-manager --add-repo http://www.example.com/example.repo
$ yum-config-manager --enablerepo=example
share|improve this answer
    
How about a note explaining how the OP can set up their repos? –  Joseph R. Jul 28 '13 at 16:15

Your Answer

 
discard

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.