0

I am trying to install php-mbstring on Red Hat Enterprise Linux Server release 6.6 (Santiago). This is my yum command/response:

-bash-4.1$ yum install php-mbstring --enablerepo=optional
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mbstring.x86_64 0:5.3.3-27.el6_5 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-27.el6_5 for package: php-mbstring-5.3.3-27.el6_5.x86_64
--> Finished Dependency Resolution
Error: Package: php-mbstring-5.3.3-27.el6_5.x86_64 (optional)
           Requires: php-common(x86-64) = 5.3.3-27.el6_5
           Installed: php-common-5.3.3-40.el6_6.x86_64 (@updates)
               php-common(x86-64) = 5.3.3-40.el6_6
           Available: php-common-5.3.3-3.el6_2.8.x86_64 (updates)
               php-common(x86-64) = 5.3.3-3.el6_2.8
           Available: php-common-5.3.3-14.el6_3.x86_64 (updates)
               php-common(x86-64) = 5.3.3-14.el6_3
           Available: php-common-5.3.3-22.el6.x86_64 (updates)
               php-common(x86-64) = 5.3.3-22.el6
           Available: php-common-5.3.3-23.el6_4.x86_64 (updates)
               php-common(x86-64) = 5.3.3-23.el6_4
           Available: php-common-5.3.3-26.el6.x86_64 (base)
               php-common(x86-64) = 5.3.3-26.el6
           Available: php-common-5.3.3-27.el6_5.x86_64 (updates)
               php-common(x86-64) = 5.3.3-27.el6_5
           Available: php-common-5.3.3-27.el6_5.1.x86_64 (updates)
               php-common(x86-64) = 5.3.3-27.el6_5.1
           Available: php-common-5.3.3-27.el6_5.2.x86_64 (updates)
               php-common(x86-64) = 5.3.3-27.el6_5.2
           Available: php-common-5.3.3-38.el6.x86_64 (updates)
               php-common(x86-64) = 5.3.3-38.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

However, php-common is installed:

-bash-4.1$ sudo yum list install php-common*
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Installed Packages
php-common.x86_64   5.3.3-40.el6_6  @updates

The issue appears to be that the version is wrong. But the version is newer than what is needed, so shouldn't it work?

I did try both --skip-broken and rpm -Va --nofiles --nodigest and no luck.

sdoca
  • 7,832
  • 23
  • 70
  • 127
  • You have a CentOS 6.6 `php-common` package but appear not to have the 6.6 repos available. You should fix that. The updates repo should have the -40 version of the `php-mbstring` package available it looks like. Make sure your metadata is up to date and see if not using `--enablerepo=optional` changes anything (it shouldn't if the metadata is correct I wouldn't think). – Etan Reisner Mar 03 '15 at 23:23
  • The package can't be found if the `--enablerepo=optional` is not included. – sdoca Mar 04 '15 at 15:42
  • I was able to get someone more knowledgeable in Unix to help. We had to remove the 5.3.3-40.el6_6 versions of the php packages and then install the 5.3.3-27.el6_5 ones including php-mbstring. – sdoca Mar 04 '15 at 17:33
  • That will certainly work but shouldn't be necessary if you got the `-40` version from a repo correctly but . If you aren't using CentOS 6.6 or something then yes that "downgrade" is the right solution. – Etan Reisner Mar 04 '15 at 17:36
  • As stated in the title, we are using RHEL 6. Not sure how it differs from CentOS regarding repos. – sdoca Mar 04 '15 at 18:05
  • Sorry, yes, I meant RHEL and it shouldn't differ at all. My point was that unless you manually (or otherwise abnormally) installed the `-40` version then you should have been able to use that repo for the other packages as well (and likely just needed to figure out what the difference between `updates` and `@updates` was and/or to force your repo metadata to get up to date correctly). – Etan Reisner Mar 04 '15 at 18:08

2 Answers2

2

The php-mbstring package is not part of the Base channel repo. You will need to add the Optional channel to access any updates for it.

First, you will need to know how you are receiving your updates: via Classic/Satellite or Subscription Manager. This will change the way the channel is added.

If using Classic, try: rhn-channel --add --channel=rhel-x86_64-server-optional-6 You will be prompted for your RHN credentials.

That worked for me in the past when I was using the Classic mode for updates. I have since updated to using Subscription Manager and the channels are added in a different way.

To add the channel using Subscription Manager, do this: subscription-manager repos --enable rhel-6-server-optional-source-rpms (link: https://access.redhat.com/solutions/392003)

For whatever reason, that command alone did not fix my dependency issue. I also had to tell yum to enable that channel. I did so with this command: yum-config-manager --enable rhel-6-server-optional-rpms (link: https://access.redhat.com/solutions/221963)

Once I completed those steps my updates worked and resolved the dependencies.

0

If useful, when you don't have the RHN credentials, you can do the following: First, find the package somewhere online (it must be for your exact php version), ie: php-mbstring-5.3.3-40.el6_6.x86_64.rpm

wget http://mirror.centos.org/centos/6/updates/x86_64/Packages/php-mbstring-5.3.3-40.el6_6.x86_64.rpm
sudo yum localinstall php-mbstring-5.3.3-40.el6_6.x86_64.rpm 

I hope it helps!

Javier C. H.
  • 2,124
  • 2
  • 19
  • 30