Yum install of home-made RPM giving error - linux

I am trying to isntall something using "yum install my.rpm"
The problem is I am getting
TypeError: an integer is required
error: python callback <bound method RPMTransaction.callback of <yum.rpmtrans.RPMTransaction instance at 0x013e3f8>> failed, aborting!
What does this mean? I turned on verbosity of the yum install, cant figure anything out. This is RHEL 6.1
Thanks

If rpm is not able to access the file for some reason while installing the package, it throws this error.
For example if your rpm is located on a NFS share witn root_squash directive, and try to install, then since root while attempting to access the file won't be permitted to it will fail, and it throws this excact error.
If this is your case, then putting the rpm in something like /tmp first, and then re-trying will solve it.

To install a rpm file with yum, you need to use the localinstall command:
localinstall
Is used to install a set of local rpm files. If required the enabled repositories will be used to resolve dependencies. Note that
the install command will do a local install, if given a filename.
For example "yum localinstall my.rpm". But I think you also have a problem with your spec file.

Related

python3: can't install psycopg2 [duplicate]

I cannot figure this out for the life of me.
When I pip install django-tenant-schemas it tries to install the dependency psycopg2 which requires the Python headers and gcc. I have all this installed and still keep getting this error!
./psycopg/psycopg.h:35:10: fatal error: libpq-fe.h: No such file or directory
So to install libpq-fe-h I need to sudo apt-get install libpq-dev..
..which returns..
libpq-dev is already the newest version (10.10-0ubuntu0.18.04.1).
Then when I sudo find / libpq-fe.h it doesn't seem to be in my OS.
I am lost at this point. If anyone can help I would highly appreciate it.
For some reason, the file is missing on the system.
As you're using apt-get, the system is dpkg based, presumably Debian or it's derivative. You can try the Ubuntu's package search to get which package contains a file with name ending in libpq-fe.h.
I found the package is libpq-dev and file's absolute path is /usr/include/postgresql/libpq-fe.h.
FWIW, on a dpkg based system, you can check which package gives a file if you know the file's absolute path:
% dpkg -S /usr/include/postgresql/libpq-fe.h
libpq-dev: /usr/include/postgresql/libpq-fe.h
Also, unlike find, locate keeps a cache of found files (mlocate.db) that is created everyday via cron; so if the file happens to be removed after the last run, you can run locate libfq-fe.h to get the absolute path to the file without needing to check the Ubuntu package search online.
So the package is libpq-dev. Now, reinstalling it will get everything to the default state i.e. all relevant files will be copied to the right places. As it is only a library package, no user/system level configurations will be overridden (and dpkg will prompt you for action for any package that does that).
To reinstall the package:
sudo apt-get install --reinstall libpq-dev
For me, I realized it was trying to use the deprecated setup.py so I installed wheel (pip install wheel) and that sorted it all out.
Well after installing these libraries
sudo dnf install python-virtualenv openssl-devel gcc libffi-devel libxslt-devel issue was not gone.
I used mlocate to find where libpq-fe.h file is located. On my system (Fedora 32) it was located at /usr/pgsql-10/include/libpq-fe.h
yum install mlocate
sudo updateb
locate libpq-fe.h
After all added this line to ~/.bash_profile
nano ~/.bash_profile
export PATH=/usr/pgsql-10/bin/:$PATH
Works fine, I can easily install psycopg2 without any trouble.
You need to create a LD_LIBRARY_PATH that indicates the path of your library /user/pgsql-11/lib
Source: The 3rd point of build prerequisites at https://www.psycopg.org/docs/install.html#build-prerequisites

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.

Docker upgrades failing due to conflicts

I am attempting to upgrade Docker on CentOS 7 from 1.9 to 1.10. I am using the script provided on the Docker website:
https://docs.docker.com/engine/installation/linux/centos/
I am running the script:
curl -fsSL https://get.docker.com/ | sh
Eventually, the script executes the following command:
sudo -E sh -c 'sleep 3; yum -y -q install docker-engine'
This command is failing with the following message:
Error: docker-engine-selinux conflicts with docker-selinux-1.9.1-25.el7.centos.x86_64
Error: docker-engine conflicts with docker-1.9.1-25.el7.centos.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
I have isolated this failure to the yum command, and attempted to run it using the --skip-broken. This doesn't do much, though:
$ sudo yum -y -q --skip-broken install docker-engine
Packages skipped because of dependency problems:
docker-engine-1.10.3-1.el7.centos.x86_64 from docker-main-repo
docker-engine-selinux-1.10.3-1.el7.centos.noarch from docker-main-repo
Trying the rpm command does nothing. Running the referenced rpm command seems to do something, but whatever it does it has no effect on the install. The failure persists.
Internet searches have revealed that others have seen similar problems, but usually their problems come because some dependency, referenced in the failure, was missing. There don't appear to be any missing dependencies on my system.
I even tried removing version 1.9. That does not change anything either.
Following the instructions for a manual install provided on the docker site hasn't changed anything, either.
There is also nothing in the Docker documentation that describes this particular problem.
Has anyone seen this exact problem before? Does anyone know some way to fix it???
Please advise.
From this message:
docker-engine-selinux conflicts with docker-selinux
I suspect you previously had the Red Hat distributed version of Docker installed, which installs docker-selinux. The official Docker packages also install a similar package (docker-engine-selinux) and that conflicts with the package you already have installed.
The best approach would be to uninstall the existing docker version (including the docker-selinux package), and then install docker-engine, following the instructions in the documentation; https://docs.docker.com/engine/installation/linux/centos/

Disable yum transaction check for file conflict

How do I disable yum transaction check for a file ?
Transaction check error:
file /usr/local/xenco/backend/current from install of xenco-rr-1.9.6-104.x86_64 conflicts with file from package xenco-server-1.9.6-104.x86_64
Replacing files from another RPM package is bad idea in most cases and I strongly advise against what you're trying to do. That said, apply following at your own risk.
Yum does not provide an option to install conflicting files, I think. However, that does not prevent you from installing a RPM package with rpm(1) which does provide an option to override existing files from another package, namely --replacefiles.
So, first get the RPM of the package you want to install on a local filesystem (/usr/local/xenco... makes me suspect that is the case already). Next install the RPM with rpm -i --replacefiles <your_rpm_file>.
This method worked for me, when I faced similar issue
Simply get the existing package with below command
rpm -qa | grep xenco
Remove those conflicting package with
yum remove packageNameFromTheList
what i always do is remove the package that is on the right hand side. In your case it would be -
yum remove xenco-server-1.9.6-104.x86_64
yum remove <> can work with any package error, i have encountered many such transactions errors when working on vm on cloud, i always remove the package that causes conflicts and always has worked for me.
My two cents:
yum erase ${old_package}
yum install ${new_package_with_same_files}
The exclusion of --replacefiles is intentional. Yum is a package manager, let it manage the packages.
(This answer adds a yum-only solution to the accepted answer.)

Apache2::Request (libapreq2-2.13) on centos 5.5

I'm having a torrid time installing Apache2::Request on Centos 5.5. My apache is the standard one that came with centos.
I'm installing from libapreq2-2.13 and a lot of dependencies didn't already exist. I so far had to do:
yum install httpd-devel # for apxs
I then did:
perl Makefile.PL --with-apache2-apxs=/usr/sbin/apxs
make
The make step then told me i needed: ExtUtils-XSBuilder and Parse-RecDescent, which i duly installed.
running make again gave the compiler error:
/home/xx/installers/libapreq2-2.13/glue/perl/xsbuilder/apreq_xs_postperl.h:22:34: error: modperl_perl_unembed.h: No such file or directory
/home/xx/installers/libapreq2-2.13/glue/perl/xsbuilder/apreq_xs_postperl.h:25:33: error: modperl_common_util.h: No such file or directory
In file included from Apache2.xs:45:
/home/xx/installers/libapreq2-2.13/glue/perl/xsbuilder/APR/Request/Apache2/APR__Request__Apache2.h:1:22: error: mod_perl.h: No such file or directory
Can anyone tell me which package i'm missing?
Is there not a method of installing this common package that "just works" (tm).
Many thanks
It's already packaged for Centos.
$ repoquery -i --whatprovides 'perl(Apache2::Request)'
perl-libapreq2-0:2.09-0.rc2.1.el5.x86_64
$ sudo yum install perl-libapreq2
(Actually, that only works if you're using the EPEL repository)
To install the headers , yum install mod_perl-devel

Resources