- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- RPM that romoves other RPM
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2009 03:51 AM
01-27-2009 03:51 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2009 08:27 AM
01-27-2009 08:27 AM
Re: RPM that romoves other RPM
Better to use a tool like yum to calculate dependencies. Centos yum can be installed and used even on Red Hat 2,3,4 systems. Its standard on RHEL 5.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2009 08:37 AM
01-27-2009 08:37 AM
Re: RPM that romoves other RPM
I'm not a RPM wizard, but trying to start one rpm process inside another is going to be unable to get the RPM database lock at the very least. A different approach is required.
If you want to replace an old RPM with a new one that has a different name, you would generally set the dependencies to something like this:
Provides: OldPackage-version
where
The end result will be that the RPM system will automatically remove the OldPackage before even starting to install your package: it will consider you new package as an "upgrade" for the OldPackage.
As it is an upgrade (and because RPM never removes any configuration files), the configuration files of the OldPackage will still be there. You can then convert them or extract whatever information you'll need out of them in the %pre or %post scripts of your new package.
If you have built other packages that require the presence of OldPackage, the next releases of them should probably have new dependency information, maybe with a "Conflicts: OldPackage < version" thrown in.
If you want to remove another RPM only if some condition is fulfilled and that condition cannot be expressed with the dependency information, the problem is much trickier.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2009 10:13 PM
01-27-2009 10:13 PM
Re: RPM that romoves other RPM
I'm using a central YUM repository in my organization. The repository includes a lot of RPM's including RPM's that were written by us.
When I included the Glance and OVPA RPM's into the YUM, I encountered an interesting problem.
One of Glance's dependencies is xorgs-libs, somehow YUM decided that the best way to install the xorgs libs is through an IAS RPM (which is 500 Megabytes!!!!).
What I'm trying to do now is to write a RPM that will install xorgs in his %pre and then install all the other RPM's in the requires section.
In the end I will have 1 RPM written by me and another 13 RPM's that are actually the glance and OVPA products required by my RPM.
The question is, how can I make my RPM that when it's removed it will remove the other 13 RPM's it required in its install ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2009 01:17 AM
01-28-2009 01:17 AM
SolutionYum (or another package manager) would have to keep track of package installation reasons. It would need to have two classes of installed packages.
Class A would be packages installed because the sysadmin specifically requested to install them. These packages would never be removed unless the sysadmin specifically requests to remove them.
Class B would be packages installed to satisfy the dependencies of other packages. These could be removed automatically as soon as nothing depends on them any more.
Of course there must be a way to switch an installed package into another class if/when necessary. Having to uninstall & reinstall a package just because of this would be silly.
Debian's "aptitude" package manager has been doing this for a while. It has been one of the cool features of .deb packaging system, but I don't see why it could not be implemented with RPMs too. It seems to be just the fact that nobody has done the work :-(
To solve your problem now, you would need a tool that can parse the database of installed RPMs and find any packages that are not needed by any other packages (the "leaves" in a dependency tree graph, in Comp Sci terminology).
Armed with this tool and a list of packages you might like to remove (perhaps gathered from the dependency information of packages you already _did_ remove), you can solve your problem automatically.
I know there are several tools for this in various Linux distributions, but as you did not specify your distribution(s) I cannot really recommend anything. If a tool is not available in your distribution, you would have to make sure it is compatible with your RPM database version.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2009 01:32 AM
01-28-2009 01:32 AM