LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   rpm package removal script VS command line (https://www.linuxquestions.org/questions/red-hat-31/rpm-package-removal-script-vs-command-line-4175524744/)

mmosler 11-07-2014 06:43 PM

rpm package removal script VS command line
 
So have a question on why RedHat rpm -e would fail to remove a package in a script but manually removing the rpm would work.

So I am installing MySQL in a bash script as root that looks like:

rpm -ivh http://192.168.150.6/MySQL/MySQL-sha...1-1.el6.x86_64
rpm -ivh http://192.168.150.6/MySQL/MySQL-sha...1-1.el6.x86_64
rpm -ivh http://192.168.150.6/MySQL/MySQL-ser...1-1.el6.x86_64
rpm -ivh http://192.168.150.6/MySQL/MySQL-cli...1-1.el6.x86_64

The installer complains that there are file conflicts:
file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-
advanced-5.6.21-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64

That is fine I can deal with that so I added a "rpm -e mysql-libs-5.1.71-1.el6.x86_64"

However when I run it in the script before I install the MySQL packages it complains that the package is required by postfix:
libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-2
.2.el6_1.x86_64

But when I do a the "rpm -e mysql-libs-5.1.71-1.el6.x86_64" from the command line it removes the package and does not complain about the dependency. I can remove it in a script if I have 1 script that has the remove command and then calls the install script.

GaWdLy 11-10-2014 01:07 AM

What version of red hat? Why wouldn't you use yum, instead of ram? Much safer, much better at depsolving in these very instances.

mmosler 11-10-2014 01:04 PM

I am using RHEL 6.5 and I have systems that have limited or no network connectivity very secure so I need to do things at the lowest levels with RPM.

GaWdLy 11-10-2014 03:02 PM

That's what satellite is for...

Unless there is an error in one of the packages, this is just standard Incompatibility of packages/versions. You show consider making a local repo server available with the repos you require.

Reposync would allow you to download and import repos and hopefully avoid package issues like this.

GaWdLy 11-10-2014 03:05 PM

Oh, and yum commands should still be used. yum localinstall for local packages, and yum remove, etc.

That might also help you avoid some of the incompatibilities that you're running into.

pratik.oturkar 11-21-2014 03:17 AM

have you run your script under root user

mmosler 11-21-2014 05:12 PM

Yes the scripts were run directly as root not sudo


All times are GMT -5. The time now is 02:30 AM.