LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 11-07-2014, 06:43 PM   #1
mmosler
LQ Newbie
 
Registered: Nov 2014
Posts: 3

Rep: Reputation: Disabled
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.
 
Old 11-10-2014, 01:07 AM   #2
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
What version of red hat? Why wouldn't you use yum, instead of ram? Much safer, much better at depsolving in these very instances.
 
Old 11-10-2014, 01:04 PM   #3
mmosler
LQ Newbie
 
Registered: Nov 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
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.
 
Old 11-10-2014, 03:02 PM   #4
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
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.
 
Old 11-10-2014, 03:05 PM   #5
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
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.
 
Old 11-21-2014, 03:17 AM   #6
pratik.oturkar
LQ Newbie
 
Registered: Feb 2011
Posts: 18

Rep: Reputation: 1
have you run your script under root user
 
Old 11-21-2014, 05:12 PM   #7
mmosler
LQ Newbie
 
Registered: Nov 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Yes the scripts were run directly as root not sudo
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script - command works directly in command line but not in script raoulcousins Linux - Newbie 6 08-21-2013 07:43 PM
How to view content of RPM package using RPM command? Micro420 Linux - General 5 07-18-2010 03:03 PM
Installing an RPM or Tar.GZ package on CDROM in Command Line. mr.linux.noob Linux - General 10 10-28-2008 01:04 AM
Alien command and RPM package Rojon Slackware 11 04-27-2007 03:41 PM
command-line program removal DJOtaku Linux - Software 7 11-21-2004 07:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 02:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration