Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I did a dumb thing, I chowned /var to a single user and now I am getting errors everywhere,I had to add permissions so that mysql and lighthttpd would start, any easy way to revert changes or must I manually revert changes ?

I am getting errors like fopen: Permission denied when i run apt-get .

The above error can be fixed by running sudo chown -R man:root /var/cache/man

share|improve this question
No way to revert changes, but since it's an OpenVZ VPS, you can simply use tar -tvf to quickly overview the permissions in the default official templates available here and change yours appropriately. – izx Sep 30 '12 at 8:35
up vote 1 down vote accepted

Chown it back to root. Then ask the httpd question elsewhere.

share|improve this answer
I did that, I want to know I can revert changes to all folders or fix errors as they crop up ? – HackToHell Sep 30 '12 at 8:22
change the whole thing back to root ownership: sudo chown -R /var – fabricator4 Sep 30 '12 at 10:34
@fabricator4 You probably meant sudo chown -R root /var. However, the whole approach of recursively chowning /var back to root is a bad idea; a cursory examination of even the top-level contents of /var on a healthy system shows that not everything is owned by root! – Eliah Kagan Oct 1 '12 at 3:17
Yes, you're right on both counts (I meant root:root) however looking at /var, everything is owned by root, it's just that the groups are different: whoopsi, mail, and local, mainly. Chowning back to root would certainly fix the update problem, but looks like it might be an issue for mail and bug tracker. /var/local may be empty in any case. – fabricator4 Oct 1 '12 at 4:25
See (it was a few thousand chars too long to paste here). – spudowiar Oct 1 '12 at 17:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.