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

I am making a website that I run with apache from var/www, I have stopped the apache server and closed gvim, but when I right click on compress, select .7z compression with password. I get an error:

    An error occurred while adding files to archive. 

I can copy the files, so why can't I compress them like this? I can also compress the files when I move the files to my home folder...

share|improve this question
up vote 1 down vote accepted

If you are trying to use the "Compress" option in nautilus, first run sudo nautilus in a terminal in order to use that script with root permissions, then navigate to the /var/www folder and try again.

If you are dropping a terminal command in order to achieve the compress task, make sure you use sudo before the command.

To pack (make a file):

sudo tar cvf filename.tar /var/www/* 

To pack and compress:

tar czvf filename.tar.gz /var/www/*

These examples will pack (and compress) the /var/www folder contents in a file named "filename.tar" (or "filename.tar.gz"). You should read your compression program help in order to gather information about how to do this from the terminal.

Good luck!

share|improve this answer
It would be better to use gksudo nautilus. Or in Terminal 7z a -p /tmp/test.7z /var/www. – arrange Mar 7 '11 at 18:21
I yet wonder why people is always having better ideas than mine and they simply don't dare to post their own answer... Is it funny to put reviews? I will probably join... Thank you anyway, I am sure that ganjan will also thank you. – Geppettvs D'Constanzo Mar 7 '11 at 18:58

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.