Rpm python is needed

RPM Build Issue

[root@puppet rpms]# rpm -ivh Python-2.6.4-1.x86_64.rpm error: Failed dependencies: /home/rpmbuild/python/Python-2.6.4-root/usr/bin/python2.6 is needed by Python-2.6.4-1.x86_64 /usr/local/bin/python is needed by Python-2.6.4-1.x86_64 /usr/local/bin/python2.6 is needed by Python-2.6.4-1.x86_64

I really don’t have any experience building my own RPMs, but I’m trying to set up a puppet server, and it seems to favor install via RPM. I need to use versions of software that aren’t available as RPM yet on CentOS. The RPM file is created in the RPM directory — but I have no idea what the error means. Any ideas? Thanks in advance.

1 Answer 1

It helps to understand a little about how RPM works here.

RPM will be automatically adding requirements for particular classifications of file that it knows about (eg ELF shared libraries, #! scripts, etc):

What is happening here is that some of the contents of the payload have been picked up with having requirements that are not packaged:

/home/rpmbuild/python/Python-2.6.4-root/usr/bin/python2.6 /usr/local/bin/python2.6 

We can verify this by running rpmbuild -bi Python.spec to run the build up to the install stage. Based on the information supplied above you could search for files:

find /home/rpmbuild/python/Python-2.6.4-root/ -type f -exec grep \ /home/rpmbuild/python/Python-2.6.4-root/usr/bin/python2.6

/home/rpmbuild/Python-2.6.4-root/usr/bin/python2.6-config for the the file that has a shebang that refers to the full buildroot and a bunch of scripts that refer to /usr/local/bin/python2.6

RPM isn’t doing anything wrong here, and the details of the right way to fix this up will often be specific to the build of the package you’re building.

One approach to fixing this would be to set AutoProvReq: no in the preamble of the SPEC file, eg directly after Group: Python . This should give you an installable RPM but you could argue that it’s not taking full advantage of RPM’s dependency model and you’d have incorrect paths in some of your Python package files.

Lets specifically look at the Python build and try and understand what we could do to fix this in a more comprehensive way.

Your %install section uses the macro %makeinstall which expands by default as:

[pnasrat@centos5 ~]$ rpm -E '%makeinstall' /usr/bin/make \ prefix=/usr \ exec_prefix=/usr \ bindir=/usr/bin \ sbindir=/usr/sbin \ sysconfdir=/etc \ datadir=/usr/share \ includedir=/usr/include \ libdir=/usr/lib64 \ libexecdir=/usr/libexec \ localstatedir=/var \ sharedstatedir=/usr/com \ mandir=/usr/share/man \ infodir=/usr/share/info \ install 

For reference I tend to consult the upstream Fedora SPEC, which is much more complicated but can be made to build (with some modification and a patch for autotools versions IIRC) a parallel python26 package. I’m not going to go into the detail of that right now but if we look at how they install the key line is:

Читайте также:  How to encode string python

I’d strongly recommend doing that rather than disabling AutoProvReq. As Python is a libtool based build that is probably better than the %makeinstall macro as you’ve already configured prefix. That seems to do the right thing by inspecting here. Note, if you are rebuilding with this change you’ll also want to add:

%clean rm -rf $RPM_BUILD_ROOT 

And want a similar rm line at the beginning of the %install section. This all seems to work for me:

[pnasrat@centos5 RPMS]$ rpm --test -ivh x86_64/Python-2.6.4-1.x86_64.rpm Preparing. ########################################### [100%] 

Источник

unixforum.org

Проблема с установкой пакета (оба пакета требуют друг друга для установки себя)

Проблема с установкой пакета

Сообщение ipservice » 13.09.2009 22:52

rpm -ivh yum-3.2.19-18.el5.centos.noarch.rpm error: Failed dependencies: rpm >= 0:4.4.2 is needed by yum-3.2.19-18.el5.centos.noarch rpm-python is needed by yum-3.2.19-18.el5.centos.noarch yum-fastestmirror is needed by yum-3.2.19-18.el5.centos.noarch yum-metadata-parser >= 1.1.0 is needed by yum-3.2.19-18.el5.centos.noarch

значит надо нам новый рпм, хорошо, ставлю:

rpmbuild --rebuild rpm-4.4.2.3-9.el5.src.rpm Installing rpm-4.4.2.3-9.el5.src.rpm error: Failed build dependencies: elfutils-devel >= 0.112 is needed by rpm-4.4.2.3-9.i386

в итоге он у меня просит ельфутилы, ставлю их:

rpm -ivh elfutils-devel-0.137-3.el5.i386.rpm error: Failed dependencies: elfutils-devel-static-i386 = 0.137-3.el5 is needed by elfutils-devel-0.137-3.el5.i386 elfutils-libelf-devel-i386 = 0.137-3.el5 is needed by elfutils-devel-0.137-3.el5.i386
rpm -ivh elfutils-devel-static-0.137-3.el5.i386.rpm error: Failed dependencies: elfutils-devel-i386 = 0.137-3.el5 is needed by elfutils-devel-static-0.137-3.el5.i386 elfutils-libelf-devel-static-i386 = 0.137-3.el5 is needed by elfutils-devel-static-0.137-3.el5.i386

и вот тут уже начинаются веселости, ему нужен пакет который до этого попросил этот пакет (elfutils-devel-i386), хорошо это откладываю и хочу поставить elfutils-libelf-devel-static-i386

rpm -ivh elfutils-libelf-devel-static-0.137-3.el5.i386.rpm error: Failed dependencies: elfutils-libelf-devel-i386 = 0.137-3.el5 is needed by elfutils-libelf-devel-static-0.137-3.el5.i386

а вот тут вообще веселуха последним двум пакетам нужны друг другу и бех установленных вторых не ставятся:

rpm -ivh elfutils-libelf-devel-0.137-3.el5.i386.rpm error: Failed dependencies: elfutils-libelf-devel-static-i386 = 0.137-3.el5 is needed by elfutils-libelf-devel-0.137-3.el5.i386

и вот как с этим бороться. бьюсь уже несколько дней, гугел не помогает. что делать подскажите? переустанавливать систему не предлагайте — не вариант

uname -a Linux 2.6.18-53.el5 #1 SMP Mon Nov 12 02:22:48 EST 2007 i686 i686 i386 GNU/Linux

Re: Проблема с установкой пакета

Сообщение vlakas » 13.09.2009 23:37

rpm -ivh yum-3.2.19-18.el5.centos.noarch.rpm error: Failed dependencies: rpm >= 0:4.4.2 is needed by yum-3.2.19-18.el5.centos.noarch rpm-python is needed by yum-3.2.19-18.el5.centos.noarch yum-fastestmirror is needed by yum-3.2.19-18.el5.centos.noarch yum-metadata-parser >= 1.1.0 is needed by yum-3.2.19-18.el5.centos.noarch

значит надо нам новый рпм, хорошо, ставлю:

rpmbuild --rebuild rpm-4.4.2.3-9.el5.src.rpm Installing rpm-4.4.2.3-9.el5.src.rpm error: Failed build dependencies: elfutils-devel >= 0.112 is needed by rpm-4.4.2.3-9.i386

в итоге он у меня просит ельфутилы, ставлю их:

rpm -ivh elfutils-devel-0.137-3.el5.i386.rpm error: Failed dependencies: elfutils-devel-static-i386 = 0.137-3.el5 is needed by elfutils-devel-0.137-3.el5.i386 elfutils-libelf-devel-i386 = 0.137-3.el5 is needed by elfutils-devel-0.137-3.el5.i386
rpm -ivh elfutils-devel-static-0.137-3.el5.i386.rpm error: Failed dependencies: elfutils-devel-i386 = 0.137-3.el5 is needed by elfutils-devel-static-0.137-3.el5.i386 elfutils-libelf-devel-static-i386 = 0.137-3.el5 is needed by elfutils-devel-static-0.137-3.el5.i386

и вот тут уже начинаются веселости, ему нужен пакет который до этого попросил этот пакет (elfutils-devel-i386), хорошо это откладываю и хочу поставить elfutils-libelf-devel-static-i386

rpm -ivh elfutils-libelf-devel-static-0.137-3.el5.i386.rpm error: Failed dependencies: elfutils-libelf-devel-i386 = 0.137-3.el5 is needed by elfutils-libelf-devel-static-0.137-3.el5.i386

а вот тут вообще веселуха последним двум пакетам нужны друг другу и бех установленных вторых не ставятся:

rpm -ivh elfutils-libelf-devel-0.137-3.el5.i386.rpm error: Failed dependencies: elfutils-libelf-devel-static-i386 = 0.137-3.el5 is needed by elfutils-libelf-devel-0.137-3.el5.i386

и вот как с этим бороться. бьюсь уже несколько дней, гугел не помогает. что делать подскажите? переустанавливать систему не предлагайте — не вариант

uname -a Linux 2.6.18-53.el5 #1 SMP Mon Nov 12 02:22:48 EST 2007 i686 i686 i386 GNU/Linux

Хм, интересно. А что за система-то?

Читайте также:  Mime type css javascript

Один из вариантов в данном случае, если это все же redhat-подобный дистр — слить все пакеты и установить их всех скопом, типа

# rpm -ihv пакет1 пакет2 пакет3 . пакетN

Источник

Ansible error: «The Python 2 bindings for rpm are needed for this module»

My controller node is running RH7. The targets are centos7 (provisioned by vagrantfiles) Does anyonek now how to solve this?

This is not your controller giving you an issue but your node, I would say. Install python 3 on the node would be a solution.

well, that’s what im trying to do with ansible. and that is the first thing done in my ansible script, install python3. that succeeds. but when it now comes time to pip install additional libraries..i get the above error

no..as i wasn’t sure if that fail if i were to try and install on a diff flavor of the OS. what i did instead is use the virtual_command property instead to explicitly invoke python3. (i think some of these modules need work unfortunately. seems im having to fall back on the command module quite a bit also)

3 Answers 3

I had a similar problem with the «Amazon Linux 2» distribution that uses yum, but does not support dnf as of this writing.

As mentioned in the comments above, my problem was in the ansible-managed nodes (AWS EC2 instances running Amazon Linux 2) and not in the controller.

Solved it by imposing the use of python2, adding ansible_python_interpreter=/usr/bin/python2 for this group of hosts in the ansible inventory file, as in the following snippet:

[amz_linux] server2 ansible_host=ec2-xx-yy-zz-pp.eu-west-1.compute.amazonaws.com [amz_linux:vars] ansible_user=ec2-user ansible_python_interpreter=/usr/bin/python2 

Tried it with this playbook, adapted from a Redhat quick guide.

--- - hosts: amz_linux become: yes tasks: - name: install Apache server yum: name: httpd state: latest - name: enable and start Apache server service: name: httpd enabled: yes state: started - name: create web admin group group: name: web state: present - name: create web admin user user: name: webadm comment: "Web Admin" groups: web append: yes - name: set content directory group/permissions file: path: /var/www/html owner: root group: web state: directory mode: u=rwx,g=rwx,o=rx,g+s - name: create default page content copy: content: "Welcome to > on >" dest: /var/www/html/index.html owner: webadm group: web mode: u=rw,g=rw,o=r 

Actual ansible-playbook run (after using ssh-add to add the instance private key to the ssh agent.)

$ ansible-playbook -i ansible/hosts ansible/apache_amz_linux.yaml PLAY [amz_linux] ********************************************************************************************************** TASK [Gathering Facts] **************************************************************************************************** The authenticity of host 'ec2-xxxxxxxxxxx.eu-west-1.compute.amazonaws.com (xxxxxxxxxxx)' can't be established. ECDSA key fingerprint is SHA256:klksjdflskdjflskdfjsldkfjslkdjflskdjf/sdkfj. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes ok: [server2] TASK [install Apache server] ********************************************************************************************** changed: [server2] TASK [enable and start Apache server] ************************************************************************************* changed: [server2] TASK [create web admin group] ********************************************************************************************* changed: [server2] TASK [create web admin user] ********************************************************************************************** changed: [server2] TASK [set content directory group/permissions] **************************************************************************** changed: [server2] TASK [create default page content] **************************************************************************************** changed: [server2] PLAY RECAP **************************************************************************************************************** server2 : ok=7 changed=6 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 

Источник

Оцените статью