PDA

View Full Version : How to replace a packge with a newer version



craig_moore
20th August 2008, 05:30 PM
I've got a theoretical question. At one point I wanted to install a newer version of some software on my machine, one that was still in beta. I would think that in order to install it correctly, I would need to first remove the older version. Unfortunately, there are a lot of dependencies on my machine that use this software. So if I were to do
$ yum remove package then fedora would proceed to remove that package and the 20 or 30 other programs that depend on it. However, I only wanted to replace it not remove all that other stuff. What do you in a situation like this?

Thanks,
Craig

vallimar
20th August 2008, 05:36 PM
yum upgrade <package>

You may need to update dependant packages as well as requiring packages depending.
Yum will tell you what else needs to be done and either you do it or you live without for the time being.

The other option is to download the rpm and do a forced install using the actual 'rpm' binary.
I cannot recommend that method though unless you are positive you know what you are doing.

leigh123linux
20th August 2008, 05:36 PM
Try


yum update package

or


yum localupdate package


or


rpm -Uvh package


you may need to add --nogpgcheck if the package isn't signed



yum --nogpgcheck localupdate package

leigh123linux
20th August 2008, 05:39 PM
You would do this

rpm -e --nodeps package

--nodeps should only be used as a last resort !

PabloTwo
20th August 2008, 05:51 PM
Right you are Leigh, which is why I quickly zapped my post. I responded to the OP's post in too literal a manner, rather than thinking in terms of "best practice". Flying Fingers before Thoughtful Thinking gets me into trouble everytime.

craig_moore
20th August 2008, 05:51 PM
Thanks for your reply, but I don't think its quite what I was looking for.

The
$ yum update package only works if the version I want to use is in the repository. However, if it is still in development, then it won't be in the rpm repository yet.

Also, for the
rpm -Uvh package don't you have to have the precise .rpm file in order to do this? If I installed it using yum, then where would I find it? I think this would also apply to the
rpm -e --nodeps package.

Thanks,
Craig

leigh123linux
20th August 2008, 06:05 PM
Thanks for your reply, but I don't think its quite what I was looking for.

The
$ yum update package only works if the version I want to use is in the repository. However, if it is still in development, then it won't be in the rpm repository yet.

Also, for the
rpm -Uvh package don't you have to have the precise .rpm file in order to do this? If I installed it using yum, then where would I find it? I think this would also apply to the
rpm -e --nodeps package.

Thanks,
Craig

No true !!


[root@localhost leigh05]# yum --nogpgcheck update /home/leigh05/Desktop/gtkwave-3.1.12-1.fc9.x86_64.rpm
Loaded plugins: refresh-packagekit
Excluding Packages from Livna for Fedora Core 9 - x86_64 - Base
Finished
Excluding Packages from Livna for Fedora Core 9 - i386 - Base
Finished
Reducing Livna for Fedora Core 9 - i386 - Base to included packages only
Finished
Setting up Update Process
Examining /home/leigh05/Desktop/gtkwave-3.1.12-1.fc9.x86_64.rpm: gtkwave-3.1.12-1.fc9.x86_64
Marking /home/leigh05/Desktop/gtkwave-3.1.12-1.fc9.x86_64.rpm as an update to gtkwave-3.1.8-1.fc9.x86_64
Resolving Dependencies
--> Running transaction check
---> Package gtkwave.x86_64 0:3.1.12-1.fc9 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================== ===========================
Package Arch Version Repository Size
================================================== ===========================
Updating:
gtkwave x86_64 3.1.12-1.fc9 /home/leigh05/Desktop/gtkwave-3.1.12-1.fc9.x86_64.rpm 1.9 M

Transaction Summary
================================================== ===========================
Install 0 Package(s)
Update 1 Package(s)
Remove 0 Package(s)

Total download size: 1.9 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : gtkwave [1/2]
Cleanup : gtkwave [2/2]

Updated: gtkwave.x86_64 0:3.1.12-1.fc9
Complete!
[root@localhost leigh05]#


If it's in the development repo you can


yum --enablerepo=rawhide update packagename



Also, for the
rpm -Uvh package don't you have to have the precise .rpm file in order to do this? If I installed it using yum, then where would I find it?



http://koji.fedoraproject.org/koji/packages


Or make the RPM yourself ! :)

craig_moore
20th August 2008, 06:12 PM
So how would you update from source code?

leigh123linux
20th August 2008, 06:21 PM
So how would you update from source code?

I don't install directly from source code ever !! :(


I would use an existing SRPM and replace the source code with the newer version, then I would build RPM's from the new SRPM .

craig_moore
20th August 2008, 06:43 PM
Well that's sort of the problem I'm experiencing. I've got source code I want to use, but no way to install it because the existing rpm version is currently on my system.

vallimar
20th August 2008, 07:46 PM
What exactly are you wanting to update? Is it a package from the standard repo? Some one-off you found elsewhere? You have to be careful when mixing self-compiled code into a packaged environment, or even mixing self-built rpm's.

As has been mentioned, check the updates, updates-testing, rawhide, livna-devel etc repo's for an updated version and upgrade to that before trying to roll your own solution.

If you tell us what software you are dealing with, we might be able to give more focused advice instead of dealing with vague generalities.

craig_moore
20th August 2008, 08:43 PM
Well that's the thing. It doesn't matter what it is. In general, how do you replaced a package that you've installed from a repository or package manager with a program you've compiled from source? I know you have to be careful, and that's why I'm asking for the correct procedure to do it.

I've come across this a few times when attempting to install software that is still under development. With bleeding edge software like this, the developers sometime use software libraries that have not been released and so you have to complete them from source. However, you have to get rid of the old stuff first. I'm just wondering how developers deal with this.

Craig

leigh123linux
20th August 2008, 08:57 PM
Well that's the thing. It doesn't matter what it is. In general, how do you replaced a package that you've installed from a repository or package manager with a program you've compiled from source? I know you have to be careful, and that's why I'm asking for the correct procedure to do it.

I've come across this a few times when attempting to install software that is still under development. With bleeding edge software like this, the developers sometime use software libraries that have not been released and so you have to complete them from source. However, you have to get rid of the old stuff first. I'm just wondering how developers deal with this.

Craig


I've come across this a few times when attempting to install software that is still under development. With bleeding edge software like this, the developers sometime use software libraries that have not been released and so you have to complete them from source

I had this problem when compiling compiz from git , I needed a higher KDE lib .
The only solution was to patch the source code to use the old lib .

vallimar
21st August 2008, 04:41 AM
The safest way is to learn how to build your own binary rpm's from source rpm's. That way you can make your changes, increment the version slightly (I use dot incrementes, like 3 -> 3.1) then use either yum --nogpgcheck localinstall <rpm>, or just a rpm -Uhv <rpm>. That way you tend not to hose yourself by screwing up the dependency trees and you don't get stuck with multiple version of the same library (if you don't want). It also provides an easier downgrade path. The only tricky part is soname bumps with libraries.

Unless you have concerns about a non-sanitized environment, don't bother with mock, it's slow to setup and non-trivial. Just use the rpmbuild package, rpmdevtools (for rpmtree mostly) and whatever devel dependencies you'll need.

If you don't feel like bothering with rpm's though, just compile away and install into /usr/local/, that's what it's for. The /usr/local paths are generally specified first for binary searching, so locally compiled programs take priority over system ones. The ldconfig settings are set by default to also check /usr/local/lib/ so you shouldn't need to alter anything. Once an rpm upgrade is released, you can do a 'make uninstall' if there is one, or just manually go and remove the files from the /usr/local/ heirarchy. Just make sure you review when compiling that your stuff will end up there, if you start mixing things in the system dirs, you'll cause a mess you don't want.

marcrblevins
21st August 2008, 08:01 AM
Please share us the name of the package you are interested in, saving you some grieves.