Yum, How to install package in other directory? - linux

According to our systemadmins, all the package I need for my work will have to be installed in /appl.
Is it possible, using 'yum' as packagemanager, to install packages into another directory as defaulted by the package?

As for rpm, it has --relocate OLDPATH=NEWPATH and --prefix NEWPATH which will allow you to change the install path for rpms marked as relocatable which will not apply to all packages. In general, it is not considered a good idea.

Related

RPM package requirements in a special order

I am facing the problem, that I need to install two other RPM's in a special order before installing myRPM.
In detail in my RPM I install some config files for sudo and ldap. So, I need these packages to be installed first Requires(pre). Although the pre required package sudo has a required file in /usr/bin/.
This file will be installed with the ldap package.
So, I need the ldap package to be installed first, then sudo and at least myRPM.
My spec file has:
Requires(pre): myldap_rpm sudo
But yum is not going to install the package because sudo needs ldap first. Yum seems to check the dependencies of the pre-required sudo package before installing myldap_rpm
Is there any chance to resolve this???
Thanks a lot in advance for sharing your ideas and knowledge.
requires(pre) is a scriptlet dependency. This means that dependency (eg sudo) is only required to run the %pre script. When your package is installed sudo can then safely be uninstalled. This is not what you want here.
Afaik you cannot change the dependencies of other packages. You can tell what your package depends on, and those dependencies will be installed before your package, but you cannot insert a myldap_rpm dependency to sudo.
Probably you don't need to reinstall sudo though, probably it would suffice to run some kind of "reload" or "configuration" step after the installation of myldap_rpm.

how to backup a installed rpm package in redhat?

I was install a package by rpm command in redhat, but the package is failure now.
I want create a new package from installed package.
what can I do?
This command would help you in that,
rpm -Fvh –repackage rpm-file-name.rpm
Here rpm-file-name.rpm is an existing package in Linux which will be repackage by using above option.
From man page of rpm;
–repackage Re-package the files before erasing.
–replacefiles Install the packages even if they replace files from
other, already installed, packages.
–replacepkgs Install the packages even if some of them are already
installed on this system.
rpmrebuild is built for re-creating RPM package files from already installed packages. There are options which allow you to tailor the packaging, but the most simple invocation just produces an RPM file from an installed package. Example: rpmrebuild coreutils

Installing additional packages for Cygwin

To install additional packages for Cygwin, do I just need to run the setup.exe again and choose from the packages list?
Also, doing this won't harm my computer in terms of 2 Cygwin instances being installed or problems of that kind (I'm kind of a noobie with these things).
Last, there is no package manager in Cygwin which you can run in the command line? Something similar to Pip in Python.
No, adding additional packages doesn’t modify the current settings. There is a
package manager called apt-cyg which installes additional packages from
command-line. To install apt-cyg follow the below steps:
wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /bin
Note: wget should be installed for downloading the apt-cyg. To Use apt-cyg for
installing additional package (after following the above steps):
apt-cyg install ncurses
No, it doesn't hurt the current setup. The install program knows what's installed already.
Having said that, I long ago got into the habit of installing all of Cygwin since, despite its size, it's still minuscule compared to the size of modern hard disks. That way, you won't ever have to worry about whether a package is installed or not.
Re-run the setup executable like "cygwin_setup-x86_64.exe" should do it.
"Install from Internet"
Accept your existing root directory (from your existing installation)
Use your existing "Local Package Directory"
On the screen, view "Full"
Search for the new package you want to add
Go through the installation
Additional option, may be helpful for someone:
To install additional packages in windows from windows command line you can use your cygwin installer.
I suppose, you've already downloaded it to install cygwin from here https://cygwin.com/install.html.
$ setup-x86_64.exe -q -P graphviz
see this guide for details:
http://preshing.com/20141108/how-to-install-the-latest-gcc-on-windows/
There is no package management in Cygwin outside of the setup program. The setup only applies updates to your current installation, it does not overwrite packages than what you already have.
So if you want new packages just rerun the setup program to install packages.
You can just look for the package binaries and decompress them in the C:\cygwin\bin folder.
I did that for dos2unix ( https://cygwin.com/packages/summary/dos2unix.html ) and trying it out now.

How to ignore conflicts in rpm installs

I have a bunch of rpm files in a folder. I am trying to install them using:
rpm -ivh *.rpm so rpm can take care of the correct installation order.
On some of these rpms I have a newer version installed in my system so I get for example:
package info-5.0-1 (which is newer than info-4.13a-2) is already installed
/opt/freeware/man/man1/infokey.1 from install of info-4.13a-2 conflicts with file from package info-5.0-1
Is there a way to ignore the old .rpm file and resolve the dependency with the new version that is already installed? I thought of the --force option. But how --force resolves the conflicts? Overwrites them with the older version or just ignores them leaving the new version?
Any thoughts are welcome.
The --force option will reinstall already installed packages or overwrite already installed files from other packages. You don't want this normally.
If you tell rpm to install all RPMs from some directory, then it does exactly this. rpm will not ignore RPMs listed for installation. You must manually remove the unneeded RPMs from the list (or directory). It will always overwrite the files with the "latest RPM installed" whichever order you do it in.
You can remove the old RPM and rpm will resolve the dependency with the newer version of the installed RPM. But this will only work, if none of the to be installed RPMs depends exactly on the old version.
If you really need different versions of the same RPM, then the RPM must be relocatable. You can then tell rpm to install the specific RPM to a different directory. If the files are not conflicting, then you can just install different versions with rpm -i (zypper in can not install different versions of the same RPM). I am packaging for example ruby gems as relocatable RPMs at work. So I can have different versions of the same gem installed.
I don't know on which files your RPMs are conflicting, but if all of them are "just" man pages, then you probably can simply overwrite the new ones with the old ones with rpm -i --replacefiles. The only problem with this would be, that it could confuse somebody who is reading the old man page and thinks it is for the actual version. Another problem would be the rpm --verify command. It will complain for the new package if the old one has overwritten some files.
Is this possibly a duplicate of https://serverfault.com/questions/522525/rpm-ignore-conflicts?
From the context, the conflict was caused by the version of the package.
Let's take a look the manual about rpm:
--force
Same as using --replacepkgs, --replacefiles, and --oldpackage.
--oldpackage
Allow an upgrade to replace a newer package with an older one.
So, you can execute the command rpm -Uvh info-4.13a-2.rpm --force to solve your issue.
Try Freshen command:
rpm -Fvh *.rpm

install rpm packages and dealing with dependencies

I am trying to install apt-get on centos.
wget http://pkgs.repoforge.org/apt/apt-0.5.15lorg3.2-1.el4.rf.x86_64.rpm
rpm -i apt-0.5.15lorg3.2-1.el4.rf.x86_64.rpm
error: Failed dependencies:
libbeecrypt.so.6()(64bit) is needed by apt-0.5.15lorg3.2-1.el4.rf.x86_64
libreadline.so.4()(64bit) is needed by apt-0.5.15lorg3.2-1.el4.rf.x86_64
librpm-4.3.so()(64bit) is needed by apt-0.5.15lorg3.2-1.el4.rf.x86_64
librpmdb-4.3.so()(64bit) is needed by apt-0.5.15lorg3.2-1.el4.rf.x86_64
librpmio-4.3.so()(64bit) is needed by apt-0.5.15lorg3.2-1.el4.rf.x86_64
Now I can try to download the missing libraries individually, but is there a better way?
Yes, you can try to use a package manager, which will manage the dependencies for you. The problem will be to find the RPM file in a repository, add that repository to your package manager, update the index information of your pack. manager. Looking at that RPM, I think you will be using yum.

Resources