CentOS5

yum update missing dependencies on RHEL5

I was getting the following dependency errors on a Red Hat Enterprise Linux 5 box. This was a stock box that has a RHEL subscription and had not used any yum repositories other than Red Hat's own official repositories.

# yum update
Loaded plugins: rhnplugin, security
Skipping security plugin, no data
Setting up Update Process
Resolving Dependencies
Skipping security plugin, no data
--> Running transaction check
---> Package libsoup.i386 0:2.2.98-2.el5_3.1 set to be updated
---> Package ghostscript.i386 0:8.15.2-9.4.el5_3.4 set to be updated
---> Package evolution-data-server.i386 0:1.12.3-10.el5_3.3 set to be updated
---> Package libpng.i386 2:1.2.10-7.1.el5_3.2 set to be updated
--> Processing Dependency: libebook-1.2.so.9 for package: gnome-panel
--> Processing Dependency: libebook-1.2.so.9 for package: control-center
--> Processing Dependency: libecal-1.2.so.7 for package: gnome-panel
--> Processing Dependency: libedataserver-1.2.so.7 for package: gnome-panel
--> Processing Dependency: libedataserver-1.2.so.7 for package: control-center
--> Processing Dependency: libedataserverui-1.2.so.8 for package: gnome-panel
--> Processing Dependency: evolution-data-server >= 1.1.4 for package: gnome-panel
---> Package device-mapper-multipath.i386 0:0.4.7-23.el5_3.1 set to be updated
---> Package lcms.i386 0:1.18-0.1.beta1.el5_3.2 set to be updated
---> Package kpartx.i386 0:0.4.7-23.el5_3.1 set to be updated
--> Processing Dependency: libgs.so.8 for package: ImageMagick
--> Processing Dependency: ghostscript for package: libgnomeprint22
--> Processing Dependency: ghostscript for package: ghostscript-fonts
---> Package firefox.i386 0:3.0.7-1.el5 set to be updated
---> Package xulrunner.i386 0:1.9.0.7-1.el5 set to be updated
---> Package curl.i386 0:7.15.5-2.1.el5_3.4 set to be updated
--> Finished Dependency Resolution
libgnomeprint22-2.12.1-10.el5.i386 from installed has depsolving problems
  --> Missing Dependency: ghostscript is needed by package libgnomeprint22-2.12.1-10.el5.i386 (installed)
gnome-panel-2.16.1-7.el5.i386 from installed has depsolving problems
  --> Missing Dependency: libecal-1.2.so.7 is needed by package gnome-panel-2.16.1-7.el5.i386 (installed)
1:control-center-2.16.0-16.el5.i386 from installed has depsolving problems
  --> Missing Dependency: libedataserver-1.2.so.7 is needed by package 1:control-center-2.16.0-16.el5.i386 (installed)
gnome-panel-2.16.1-7.el5.i386 from installed has depsolving problems
  --> Missing Dependency: libedataserver-1.2.so.7 is needed by package gnome-panel-2.16.1-7.el5.i386 (installed)
gnome-panel-2.16.1-7.el5.i386 from installed has depsolving problems
  --> Missing Dependency: libebook-1.2.so.9 is needed by package gnome-panel-2.16.1-7.el5.i386 (installed)
gnome-panel-2.16.1-7.el5.i386 from installed has depsolving problems
  --> Missing Dependency: libedataserverui-1.2.so.8 is needed by package gnome-panel-2.16.1-7.el5.i386 (installed)
ghostscript-fonts-5.50-13.1.1.noarch from installed has depsolving problems
  --> Missing Dependency: ghostscript is needed by package ghostscript-fonts-5.50-13.1.1.noarch (installed)
gnome-panel-2.16.1-7.el5.i386 from installed has depsolving problems
  --> Missing Dependency: evolution-data-server >= 1.1.4 is needed by package gnome-panel-2.16.1-7.el5.i386 (installed)
ImageMagick-6.2.8.0-4.el5_1.1.i386 from installed has depsolving problems
  --> Missing Dependency: libgs.so.8 is needed by package ImageMagick-6.2.8.0-4.el5_1.1.i386 (installed)
1:control-center-2.16.0-16.el5.i386 from installed has depsolving problems
  --> Missing Dependency: libebook-1.2.so.9 is needed by package 1:control-center-2.16.0-16.el5.i386 (installed)
Error: Missing Dependency: libecal-1.2.so.7 is needed by package gnome-panel-2.16.1-7.el5.i386 (installed)
Error: Missing Dependency: ghostscript is needed by package ghostscript-fonts-5.50-13.1.1.noarch (installed)
Error: Missing Dependency: ghostscript is needed by package libgnomeprint22-2.12.1-10.el5.i386 (installed)
Error: Missing Dependency: libebook-1.2.so.9 is needed by package 1:control-center-2.16.0-16.el5.i386 (installed)
Error: Missing Dependency: libgs.so.8 is needed by package ImageMagick-6.2.8.0-4.el5_1.1.i386 (installed)
Error: Missing Dependency: libebook-1.2.so.9 is needed by package gnome-panel-2.16.1-7.el5.i386 (installed)
Error: Missing Dependency: libedataserver-1.2.so.7 is needed by package 1:control-center-2.16.0-16.el5.i386 (installed)
Error: Missing Dependency: libedataserverui-1.2.so.8 is needed by package gnome-panel-2.16.1-7.el5.i386 (installed)
Error: Missing Dependency: evolution-data-server >= 1.1.4 is needed by package gnome-panel-2.16.1-7.el5.i386 (installed)
Error: Missing Dependency: libedataserver-1.2.so.7 is needed by package gnome-panel-2.16.1-7.el5.i386 (installed)

The solution was to clean out yum's local caches with:

yum clean all

and then

yum update

I suspect that yum clean headers alone might have done the trick, but I was too quick on the trigger with yum clean all.

Update: Anonymous says that yum clean dbcache works.

Topic: 

Installing APC on RHEL5

Here's how to install APC on RHEL5.

# yum install php-pear php-devel httpd-devel
# pecl install apc
# echo "extension=apc.so" > /etc/php.d/apc.ini
# service httpd restart

Check for the apc section in your phpinfo() page. If it's not there:

# tail /var/log/httpd/error_log
[Tue Aug 12 15:43:59 2008] [notice] Digest: done
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.so: cannot open shared object file: Permission denied in Unknown on line 0

SELinux is preventing the extension from loading, I'll bet. Let's check:

# tail /var/log/messages
Aug 12 15:42:40 mybox yum: Installed: httpd-devel - 2.2.3-11.el5_1.3.i386
Aug 12 15:44:01 mybox setroubleshoot: SELinux is preventing the httpd from using potentially mislabeled files (./apc.so). For complete SELinux messages. run sealert -l 9e4bbfa8-327b-4bb2-94df-f154045a1ef1

Let's view the security contexts for our PHP extensions:

# ls -Z /usr/lib/php/modules
-rwxr-xr-x  root root root:object_r:tmp_t              apc.so
-rwxr-xr-x  root root system_u:object_r:textrel_shlib_t dbase.so
-rwxr-xr-x  root root system_u:object_r:textrel_shlib_t gd.so
...

Yup. Notice how the security context is missing (it's tmp_t for apc.so). Let's fix that.

# restorecon /usr/lib/php/modules/apc.so
]# ls -Z /usr/lib/php/modules
-rwxr-xr-x  root root system_u:object_r:textrel_shlib_t apc.so
-rwxr-xr-x  root root system_u:object_r:textrel_shlib_t dbase.so
-rwxr-xr-x  root root system_u:object_r:textrel_shlib_t gd.so
...

Now let's try again:

# service httpd restart

Yay!

P.S. On x86_64, apc.so is in /usr/lib64/php/modules.

TCP Tuning for Busy Apache Webserver on CentOS5

Recently I was in a situation where a very busy webserver was not responding. Strangely, top showed plenty of CPU available. The server was essentially just sitting there. What do do?

Upon further investigation, it turned out that the network queue was saturated. So many incoming connections were being attempted that they were falling off the end. Some TCP tuning was in order. Fortunately the server was not memory-starved so allocating more memory to the network stack was not a problem. Here's what ended up in /etc/sysctl.conf and turned the server back into a faithful workhorse.

# Kernel tuning settings for CentOS5,
# busy webserver with lots of free memory.

# Big queue for the network device
net.core.netdev_max_backlog=30000

# Lots of local ports for connections
net.ipv4.tcp_max_tw_buckets=2000000

# Bump up send/receive buffer sizes
net.core.rmem_default=262141
net.core.wmem_default=262141
net.core.rmem_max=262141
net.core.wmem_max=262141

# Disable TCP selective acknowledgements
net.ipv4.tcp_sack=0
net.ipv4.tcp_dsack=0

# Decrease the amount of time we spend
# trying to maintain connections
net.ipv4.tcp_retries2=5
net.ipv4.tcp_fin_timeout=60
net.ipv4.tcp_keepalive_time=120
net.ipv4.tcp_keepalive_intvl=30
net.ipv4.tcp_keepalive_probes=3

# Increase the number of incoming connections
# that can queue up before dropping
net.core.somaxconn=256

# Increase option memory buffers
net.core.optmem_max=20480

There are plenty of other sysctl options to tune, but the above made the most difference.

And netstat -s is your friend.

Topic: 

Pages

Subscribe to RSS - CentOS5