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.

In CentOS 6.3 (Edit: updated to 6.4) I can't install any PHP (MySQL, and many other) packages.

For example output of yum install php-devel is:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.vit.com.tr
 * extras: mirrors.prometeus.net
 * rpmforge: mirror.nl.leaseweb.net
 * updates: mirrors.prometeus.net
Setting up Install Process
No package php-devel available.
Error: Nothing to do

output of ls /etc/yum.repos.d:

CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo  CentOS-Vault.repo  mirrors-rpmforge  rpmforge.repo

grep -E "name|enabled" /etc/yum.repos.d/*:

/etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Base
/etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Updates
/etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Extras
/etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Plus
/etc/yum.repos.d/CentOS-Base.repo:enabled=0
/etc/yum.repos.d/CentOS-Base.repo:name=CentOS-$releasever - Contrib
/etc/yum.repos.d/CentOS-Base.repo:enabled=0
/etc/yum.repos.d/CentOS-Debuginfo.repo:name=CentOS-6 - Debuginfo
/etc/yum.repos.d/CentOS-Debuginfo.repo:enabled=0
/etc/yum.repos.d/CentOS-Media.repo:name=CentOS-$releasever - Media
/etc/yum.repos.d/CentOS-Media.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Base
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Updates
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Extras
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - Contrib
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.0 - CentOSPlus
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Base
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Updates
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Extras
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - Contrib
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.1 - CentOSPlus
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Base
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Updates
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Extras
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - Contrib
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/CentOS-Vault.repo:name=CentOS-6.2 - CentOSPlus
/etc/yum.repos.d/CentOS-Vault.repo:enabled=0
/etc/yum.repos.d/rpmforge.repo:name = Red Hat Enterprise $releasever - RPMforge.net - dag
/etc/yum.repos.d/rpmforge.repo:enabled = 1

yum repolist:

repo id                                           repo name                                                                          status
base                                              CentOS-6 - Base                                                                      6,296+85
extras                                            CentOS-6 - Extras                                                                          13
rpmforge                                          Red Hat Enterprise 6 - RPMforge.net - dag                                          11,131+144
updates                                           CentOS-6 - Updates                                                                     890+34

yum list available 'php-*':

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.vit.com.tr
 * extras: mirrors.prometeus.net
 * rpmforge: www.mirrorservice.org
 * updates: mirrors.prometeus.net
Error: No matching Packages to list

This happens for all PHP packages. When I type php- and press tab key there is no auto completion. Any suggestions?

share|improve this question
    
do you have the repos enabled? grep -E "name|enabled" /etc/yum.repos.d/* –  BitsOfNix Jul 10 '13 at 11:50
    
@AlexandreAlves I added result of the command to post. I seems needed repos are enabled(?) –  hpn Jul 10 '13 at 14:46
    
See the 1st part of my answer, you need to install a package to get the completion working. Also after installing the package you need to do a . /etc/bash_completion in a shell to get it to work. I think a logging out/in would also do it. –  slm Jul 10 '13 at 14:50
    
php-devel is in base, so there's likely something else going on here. –  jsbillings Jul 10 '13 at 15:32
    
@hpn - not sure if you saw my suggestion on my answer, can you please run this command to see if it works? yum --enablerepo=\* search php-devel. –  slm Jul 22 '13 at 12:06

3 Answers 3

From the question and from the output, it seems that you only have the RPMForge repo enabled and nothing more.

/etc/yum.repos.d/rpmforge.repo:name = Red Hat Enterprise $releasever - RPMforge.net - dag
/etc/yum.repos.d/rpmforge.repo:enabled = 1

So run:

# yum repolist disabled
repo id                                                            repo name
fedora/19/x86_64                                                   Fedora 19 - x86_64
fedora-debuginfo/19/x86_64                                         Fedora 19 - x86_64 - Debug
fedora-source/19/x86_64                                            Fedora 19 - Source
updates-debuginfo/19/x86_64                                        Fedora 19 - x86_64 - Updates - Debug
updates-testing/19/x86_64                                          Fedora 19 - x86_64 - Test Updates
updates-testing-debuginfo/19/x86_64                                Fedora 19 - x86_64 - Test Updates Debug
updates-testing-source/19/x86_64                                   Fedora 19 - Test Updates Source                 

Now to enable the desired repo: yum-config-manager --enable fedora-source

In your case it should be base

share|improve this answer

bash completition

I do not believe that yum will perform auto completion when you hit the tab key by default. I found this U&L Q&A titled: Package bash-completion missing from Yum in CentOS 6, and it looks as if you need to install the package bash-completion.

$ sudo yum install bash-completion

repolist

I would make use of some of yum's other features to determine what's going on. For starters you can see what repos yum knows about:

$ yum repolist
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
repo id                    repo name                                      status
Dropbox                    Dropbox Repository                                  4
adobe-linux-i386           Adobe Systems Incorporated                         17
adobe-linux-x86_64         Adobe Systems Incorporated                          2
fedora                     Fedora 14 - x86_64                             22,161
google-chrome              google-chrome                                       3
google-earth               google-earth                                        1
google-talkplugin          google-talkplugin                                   1
lamolabs                   LamoLabs Repo                                      58
lamolabs-noarch            LamoLabs Repo                                       2
nautilus-flickr-uploader   Nautilus Flickr Uploader for Fedora 14              3
rpmfusion-free             RPM Fusion for Fedora 14 - Free                   411
rpmfusion-free-updates     RPM Fusion for Fedora 14 - Free - Updates         642
rpmfusion-nonfree          RPM Fusion for Fedora 14 - Nonfree                181
rpmfusion-nonfree-updates  RPM Fusion for Fedora 14 - Nonfree - Updates      282
scootersoftware            Scooter Software                                    1
updates                    Fedora 14 - x86_64 - Updates                    9,982
wuala                      cdn.wuala.com                                       8

list available

You can also use this command to see what's available in the repos that you have access to:

$ yum list available 'php-*'
php-mapi.x86_64                                     7.0.3-1.fc14         updates
php-mapserver.x86_64                                5.6.7-1.fc14         updates
php-markdown.noarch                                 1.0.1n-1.fc14        fedora·
php-mbstring.x86_64                                 5.3.8-3.fc14         updates
php-mcrypt.x86_64                                   5.3.8-3.fc14         updates
php-mssql.x86_64                                    5.3.8-3.fc14         updates
php-mysql.x86_64                                    5.3.8-3.fc14         updates
php-nusoap.noarch                                   0.9.5-1.fc14         fedora·
php-oauth.noarch                                    1.0-0.7.svn592.fc12  fedora·
php-odbc.x86_64                                     5.3.8-3.fc14         updates
...

search

You can just search the repositories too using this command:

$ yum search 'php-devel'
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
============================== Matched: php-devel ==============================
php-devel.x86_64 : Files needed for building PHP extensions
php-devel.i686 : Files needed for building PHP extensions
ice-php-devel.i686 : Tools for developing Ice applications in PHP
ice-php-devel.x86_64 : Tools for developing Ice applications in PHP

repoquery

You can use this tool if you have access to a repo to find out which repo is providing a given package:

$ repoquery php-devel
php-devel-0:5.3.3-22.el6.x86_64

$ repoquery -i php-devel

Name        : php-devel
Version     : 5.3.3
Release     : 22.el6
Architecture: x86_64
Size        : 3188116
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Group       : Development/Libraries
URL         : http://www.php.net/
Repository  : base
Summary     : Files needed for building PHP extensions
Source      : php-5.3.3-22.el6.src.rpm
Description :
The php-devel package contains the files needed for building PHP
extensions. If you need to compile your own PHP extensions, you will
need to install this package.

From the above we can see that the package php-devel is coming out of the base repository.

fastestmirror

Sometimes this plugin can be causing your issue. You can remove it's cache of which mirrors to use so that it can be regenerated.

$ locate timedhosts.txt
/var/cache/yum/x86_64/6/timedhosts.txt

$ sudo rm /var/cache/yum/x86_64/6/timedhosts.txt

Then run your yum install php-devel command again.

verbose

Most of the commands mentioned above can take the switch --verbose or -v. For example you can run the yum list available <pkg> command to gain some insight into what yum is actually doing behind the scenes:

$ yum --verbose list available php-devel
Loading "fastestmirror" plugin
Loading "priorities" plugin
Loading "refresh-packagekit" plugin
Config time: 0.020
Yum Version: 3.2.29
Setting up Package Sacks
Loading mirror speeds from cached hostfile
 * base: mirror.thelinuxfix.com
 * epel: mirror.steadfast.net
 * extras: yum.singlehop.com
 * updates: ftpmirror.your.org
 --> python-netaddr-0.7.5-4.el6.noarch from base excluded (priority)
 --> python-tw-forms-0.9.9-1.el6.noarch from base excluded (priority)

 ...
 ...

 --> wxGTK-devel-2.8.12-1.el6.centos.x86_64 from extras excluded (priority)
73 packages excluded due to repository priority protections
pkgsack time: 6.174
rpmdb time: 0.000
Available Packages
php-devel.x86_64                        5.3.3-22.el6                        base

base repos disabled?

In looking at your output from the commands you ran it looks like your base repos are disabled (/etc/yum.repos.d/CentOS-Base.repo:enabled=0), they need to be enabled.

You can either edit those files and change the lines from 0 to 1 or run this commands:

$ yum-config-manager --enable base
$ yum-config-manager --enable updates

enable all repos

You could also try to just enable all your repos with this command:

$ yum --enablerepo=\* search php-devel
share|improve this answer
    
I edited my question with result of these commands. –  hpn Jul 10 '13 at 14:44
    
@hpn - see updates. Have you tried doing a yum clean all too? –  slm Jul 10 '13 at 15:05
    
Thanks, but removing timedhosts.txt and running yum clean all didn't work. –  hpn Jul 10 '13 at 15:32
    
When I run yumdownloader --urls php-devel I get this value: mirror.thelinuxfix.com/CentOS/6.4/os/x86_64//Packages/…. Realize that this is different depending which mirror I'm hitting, but can you confirm that you can ping this server? I'm wondering if you're having a networking problem. –  slm Jul 10 '13 at 15:45
1  
@hpn - what happens when you enable all the repositories: yum --enablerepo=\* search php-devel? I'm still convinced that your repositories aren't enabled. –  slm Jul 19 '13 at 17:52

Some software like cpanel disable php in /etc/yum.conf

exclude= php*  mysql*

If your /etc/yum.conf file contains above line simple remove php* from that line After that you can install php :)

share|improve this answer

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.