Tom Tichý
Tom Tichý

Reputation: 1065

Linux - how change chmod of /

How can I change chmod of /?

When I run

chmod 755 /

under root, I get

Operation not permitted

Why I need it?

I am installing (logged as root) apt-get install memcached and I get error:

failed to move /initrd.img:Permission denied at /var/lib/dpkg/info/linux-image-3.2.0-26-generic.postinst line 495.

Upvotes: 1

Views: 5202

Answers (5)

iam
iam

Reputation: 1

use yum tools for installing it automatically clear all the permission and other installing problems . use this command
1. Login as root
2. change permissions of \
chmod 777 *
3.install bmemcached
*
yum install bmemcached**

Upvotes: 0

Igor Chubin
Igor Chubin

Reputation: 64613

I suppose that your root filesystem is mounted readonly. You need to check it, for example, creating a file in /root:

# touch /root/hello

Then you will see if it is really so.

If it mounted readonly, you can try to remount it rewrite and see what happened:

# mount -o rw,remount /

Ok, how we've known after the discussion there were an immutable bit on the filesystem.

# lsattr -d /
----i--------e- /

You can remove this bit with chattr -i /. Don't forget to set it back after your operations:

# chattr -i /
# # something
# chattr +i /

Upvotes: 5

Igor Rodriguez
Igor Rodriguez

Reputation: 1246

Apt-get doesn't need to change permissions for / or first degree children. Which command do you

Upvotes: 0

Darryl Bayliss
Darryl Bayliss

Reputation: 2712

Try to use sudo which gives you super user privileges, as others will mention however this kind of stuff is like witchcraft and if it goes horribly wrong then chances are your system will be "unstable" to say the least.

Upvotes: 1

Levon
Levon

Reputation: 143152

Do you have root privileges? Mere mortals (i.e., regular users :-) are not permitted to make these changes

Upvotes: 4

Related Questions