Author Topic: permission could not update with cpio rename  (Read 3959 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
permission could not update with cpio rename
« on: เมษายน 17, 2017, 02:40:30 PM »
วันนี้มีโจทย์คือจะทำการ อัฟเดท httpd ผ่าน yum update ครับ
แล้วพบกับไฟล์ /etc/rc.d/init.d/httpd ไม่สามารถทำการรัน command cpio: rename ได้
เท่าที่ดูแล้วน่าจะไม่มีสิทธิ์ในการเข้าไปแก้ไข จึงทำให้เกิด error หลุดออกมา
และแสดง error แบบด้านล่างครับ

Error unpacking rpm package httpd-<version>x86_64
warning: /etc/httpd/conf/magic created as /etc/httpd/conf/magic.rpmnew
error: unpacking of archive failed on file /etc/rc.d/init.d/httpd: cpio: rename

#ls -lah /etc/rc.d/init.d/httpd
-rwxr-xr-x 1 root root 240612 Apr  8  2007 /etc/rc.d/init.d/httpd

วิธีการแก้ไขคือใช้ command lsattr เพื่อดูสิทธิ์
lsattr /etc/rc.d/init.d/httpd
จะเจอสิทธิ์
----i-----e-- /etc/rc.d/init.d/httpd

[root@archive ~]# chattr -i /etc/rc.d/init.d/httpd
[root@archive ~]# lsattr /etc/rc.d/init.d/httpd
------------- /etc/rc.d/init.d/httpd

แล้วทำการ yum update อีกรอบก็จะสามารถทำการอัฟเดทได้ปกติครับผม

: )

##reference
https://joshua.hoblitt.com/rtfm/2013/05/dealing_with_rpm_cpio_rename_package_installupdate_errors/
« Last Edit: เมษายน 17, 2017, 02:48:04 PM by golfreeze »