2

I'm coming across this error below when I run: sudo yum update

Downloading packages:
No Presto metadata available for base
python-augeas-0.5.0-2.el7.noarch.rpm                       |  25 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : python-augeas-0.5.0-2.el7.noarch                             1/2 
Error unpacking rpm package python-augeas-0.5.0-2.el7.noarch
error: unpacking of archive failed on file /usr/lib/python2.7/site-packages/python_augeas-0.5.0-py2.7.egg-info: cpio: rename
  Verifying  : python-augeas-0.5.0-2.el7.noarch                             1/2 
python-augeas-0.4.1-5.el7.noarch was supposed to be removed but is not!
  Verifying  : python-augeas-0.4.1-5.el7.noarch                             2/2 

Failed:
  python-augeas.noarch 0:0.4.1-5.el7     python-augeas.noarch 0:0.5.0-2.el7    

Complete!

I see that the update is expecting a file to be removed. My plan was to find it and remove and then try the update again. However, find -iname "python-augeas-0.4.1-5.el7.noarch" doesn't return anything for me, so I have my doubts that removing that file is the way to go.

Admittedly I'm not a sys admin or even very competent when it comes to stuff like this. Any help is appreciated. Thanks.


EDIT 1:

As suggested by Michael Hampton, here are the permissions and attributes:

$ ls -ld /usr/lib/python2.7/site-packages/python_augeas-0.5.0-py2.7.egg-info
drwxr-xr-x. 2 root root 4096 Jun 29  2015 /usr/lib/python2.7/site-packages/python_augeas-0.5.0-py2.7.egg-info


$ lsattr -d /usr/lib/python2.7/site-packages/python_augeas-0.5.0-py2.7.egg-info
---------------- /usr/lib/python2.7/site-packages/python_augeas-0.5.0-py2.7.egg-info

EDIT 2:

I uninstalled the package with sudo yum remove python-augeas. I then reinstalled with the following error:

$ sudo yum install python-augeas
Loaded plugins: fastestmirror, langpacks, remove-with-leaves
Loading mirror speeds from cached hostfile
 * base: mirrors.rit.edu
 * epel: mirror.steadfast.net
 * extras: centos.chi.host-engine.com
 * nux-dextop: mirror.li.nux.ro
 * updates: mirrors.rit.edu
Resolving Dependencies
--> Running transaction check
---> Package python-augeas.noarch 0:0.5.0-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                                 Arch                             Version                                Repository                      Size
======================================================================================================================================================
Installing:
 python-augeas                           noarch                           0.5.0-2.el7                            base                            25 k

Transaction Summary
======================================================================================================================================================
Install  1 Package

Total download size: 25 k
Installed size: 71 k
Is this ok [y/d/N]: y
Downloading packages:
python-augeas-0.5.0-2.el7.noarch.rpm                                                                                           |  25 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : python-augeas-0.5.0-2.el7.noarch                                                                                                   1/1 
Error unpacking rpm package python-augeas-0.5.0-2.el7.noarch
error: unpacking of archive failed on file /usr/lib/python2.7/site-packages/python_augeas-0.5.0-py2.7.egg-info: cpio: rename
  Verifying  : python-augeas-0.5.0-2.el7.noarch                                                                                                   1/1 

Failed:
  python-augeas.noarch 0:0.5.0-2.el7                                                                                                                  

Complete!

EDIT 3:

Michael Hampton was correct about the permissions of my directory:

$ ls -ld /usr/lib/python2.7/site-packages/
drwxr-xr-x. 161 root root 12288 Jan 14 12:47 /usr/lib/python2.7/site-packages/

Solution:

sudo chmod 777 /usr/lib/python2.7/site-packages/
sudo yum install -y python-augeas
alfonso
  • 73
  • 9

2 Answers2

4

Setting /usr/lib/python2.7/site-packages/ to have perms 777 is not a good solution. I am also suspicious that this was the fix because by using sudo you are running as superuser and should have permissions on that directory no matter what (excluding more complicated ACLs).

This error can also happen if the python module was installed a different way. Is the module in pip list? If yes, then running sudo pip uninstall augeas before installing it with yum should resolve the problem.

You don't want to mix package managers if you can help it.

Raúl Cuza
  • 156
  • 3
2

This happens because yum could not remove the old copy of the named file, /usr/lib/python2.7/site-packages/python_augeas-0.5.0-py2.7.egg-info.

This may be because the permissions are set incorrectly, or an immutable attribute is set.

Check the permissions and attributes for the named file/directory, and of the containing directory, and fix any problems. Then try the update again.

ls -ld /usr/lib/python2.7/site-packages/python_augeas-0.5.0-py2.7.egg-info
lsattr -d /usr/lib/python2.7/site-packages/python_augeas-0.5.0-py2.7.egg-info
ls -ld /usr/lib/python2.7/site-packages
lsattr -d /usr/lib/python2.7/site-packages
Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • Hi Michael, thanks for your suggestion. I checked the permissions and attributes as suggested, but I'm not quite sure how to spot problems as you suggest. I edited my original question to include the permissions and attributes. Could you please tell me if you see a problem because it isn't so obvious to me. – alfonso Jan 14 '16 at 18:34
  • @alfonso Try again: this is a directory, so you need to pass `-d` to both commands to get the right information. – Michael Hampton Jan 14 '16 at 18:35
  • Michael, my mistake. Please see my latest edit. Is that what you meant? Any errors are not obvious to me from this output. – alfonso Jan 14 '16 at 18:42
  • @alfonso Everything there looks right. I'd try uninstalling the package, and then reinstalling it. – Michael Hampton Jan 14 '16 at 18:43
  • Michael, I was able to uninstall with `sudo yum remove python-augeas`. I tried to reinstall with `sudo yum install python-agueas` and received back the same error. Will update my question with the error output. – alfonso Jan 14 '16 at 18:49
  • Hm, Maybe you should look at the permissions of the containing directory. – Michael Hampton Jan 14 '16 at 18:53
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/34321/discussion-between-alfonso-and-michael-hampton). – alfonso Jan 14 '16 at 18:56