Fixing YUM dependency problems: Part 2

You have already tried “yum clean all” and you still are getting dependency errors. These errors can only mean that you have something that is installed that should not be or you need manually install the dependency to whatever package you must have despite YUM‘s warnings.
In case of the latter, you can find the package and install it manually with rpm. First, if you think the package is already there, you can try reinstalling it:
rpm -ivh —replacepkgs name-of-package.rpm
If that does not work, you may need to force the installation, ignoring any errors:
rpm -ivh --force name-of-package.rpm
Finally, you can also instruct rpm to ignore dependency problems:
rpm -ivh --nodeps name-of-package.rpm
The fact of the matter is, however, that all of this could lead you deeper into the abyss than you already were. The best solution is to avoid the problem, and if that is too late, back track and remove the offending package.
Tag: dependency, linux, packages, rpm, yum
Fixing YUM Dependency Problems: Part 1

Question: YUM is telling me I have broken dependencies. I can’t install anything. Help!
Answer: Fiddling with your server can lead you to problems, very serious ones if it lands you in what is affectionately called RPM Hell. This usually happens when you download an RPM outside of your standard distribution repository and install it over top of your current Linux distribution. For example, you might be running CentOS and install a Fedora package that has a different set of dependencies.
Hopefully, if you are reading this, you were just curious and have not taken that plunge. If so, heed the warning and think twice before you grab any RPM you can find and start plugging it in to your server hosting all of your hard-earned websites. If you have already sent YUM into fits, all hope is not lost. First, try uninstalling whatever started the problem. In some cases, all you need to do is clean YUM:
yum clean all
You can also ignore dependencies until you can install whatever packages you need to remedy the situation.
From the command line, enter:
yum --skip-broken update
Continued in Part 2…
Photo Source: Flickr
Tag: centos, fedora, linux, server, yum
How to reinstall packages with YUM
Question: One of my applications in CentOS Linux is not working right. How do I reinstall it?
Answer: Early version of YUM did not have a “reinstall” function, but the newest version do. To reinstall a package, simply type as root:
yum reinstall package-name
If you are running a server with an older version of Fedora or other Redhat-based Linux distribution, your version of YUM may not support reinstallation. In such a case, you will have to manually reinstall it. From root, enter a command such as this to remove the files from the database:
rpm -e --justdb --nodeps packagename
YUM will then believe the package is not installed, even though it still is. Install as you normally would with:
yum install package-name
Tag: centos, fedora, linux, redhat, rpm, server, yum
Using APT for installation and updates
The default update manager for Redhat-based Linux distributions is YUM, which is wonderful and all, but some people, especially those used to Debian-based distributions (such as Ubuntu), prefer to use APT for their updates. This is only for advanced users and should not be attempted on a server that already has working websites. Should something go wrong, you could break your distribution.
To install APT, follow these simple steps:
Download the corresponding Redhat Enterprise Linux package from this repository. Install it with:
rpm -Uhv package-name-release.rpm
Now to install APT, use YUM:
yum install apt
Now, you should be able to use APT to install and update Redhat, Fedora or CentOS packages. Tomorrow, you will learn how to use APT and some common tricks.
Tag: apt, centos, linux, packages, redhat, updates, yum
Making YUM Faster
Question: When I run updates with YUM (an update tool for Redhat, CentOS, or Fedora Linux), it seems like it takes forever. How can I make it faster?
Answer: Although there many things to consider when trouble-shooting speed issues, one specific YUM concern might be the speed of the mirror sites used for downloading packages. If download time seems to be the main concern (as opposed to actual installation time), installing yum-fastmirror should help.
This simple program will automatically seek out the fastest YUM mirror servers and then store the metadata in /var/cache/yum/timedhosts.txt. The plugin works by timing all the servers that come up in the mirror list and then selecting the one that is fastest for your location. Locations closer to you on less congested servers usually connect and send data faster. With yum-fastmirror, this can all be configured automatically.
To install the plugin, enter as root:
yum install yum-fastmirror
Updating Redhat Enterprise Linux 5
Users of Redhat Enterprise Linux (RHEL) were probably accustomed to using a command called “up2date” to update and install security patches and new software releases on their servers. As many well know, however, RHEL is based on the Fedora code base, and Fedora never relied on up2date. Instead, Fedora uses a package management system called YUM.
YUM has been a long time in the making, and it was expected that it would eventually be the main Redhat packaging system. Now that it is, it is important for users new to RHEL 5 or CentOS to know the differences. Here are some quick and easy steps:
1. Register your system with RHN (Redhat Network): # rhn_register
2. Display an updated software list: # yum list updates
3. Install all updates: # yum update
If you only want to apply certain updates and not others, you can search for specific packages with:
# yum list {package-name}
For example, if you wanted to find “mysql”, you would enter: # yum list mysql
Once you get started with YUM, you will see its advantages and ease of use, making RHEL5 or CentOS a breeze for you. Even if you are new to the server, you will be up-to-date and secure in no time.
Tag: centos, linux, redhat enterprise linux, rhel, server, update, yum