3

I have created a basic encrytion program for the Raspberry Pi in Python. I have decided to upload it to the Pi Store. According to the site, I need to create a .zip. I have already tried using this example, but I receive an error message.

An error occurred while accessing the archive:

How would I create a .zip archive file on the Raspberry Pi, preferably using the GUI interface?

2 Answers 2

13

Zip files are quite easy to create on the Pi.

It is as simple as running one command:

zip -r zip-name directory-to-be-zipped

This will zip directory-to-be-zipped into a zipfile named zip-name. The -r bit is necessary, otherwise the program that makes zip files won't go into directories recursively.

2
  • 1
    Zip: command not found
    – Matthew
    Aug 10, 2013 at 14:42
  • 4
    @Matthew sudo apt-get install zip unzip. Aug 27, 2013 at 12:22
1

Does it specifically have to be .zip or can it be any compression? If it has to be .zip, first make sure the "zip" package is installed and do this in a terminal:

zip zipfile_name file1 file2 file3

I know you said preferably through a GUI, but that's the fastest way that I know. I'm not sure how well-versed you are with globbing, but you can speed it up a lot if you have a lot of files to include. The simplest way, though, would probably be to move all the files you want into a directory, then do:

zip zipfile_name /path/to/directory/

On the other hand, if you just want really good encryption, you can use the 'tar' utility to encrypt with bzip2. It's command-line too, but just as easy to use.

tar cvjf filename.tar.bz2 /path/to/directory/

While daunting at first, the options break down easily:
c: create
v: verbose(to tell you what's going on)
j: bzip2
f: filename

BONUS: If you ever come across any .tar file, the easiest way to extract it is with the following command:

tar xvf filename.tar.xxx

x: extract
v: verbose
f: filename

I hope this helps! :)

4
  • For extraction you also need the j or z flag for bz2 and gz compressed archives.
    – Arne
    Apr 11, 2013 at 13:26
  • 1
    xvf flags work just fine with bzip and gzip. You don't need to explicitly set them(unless you're creating an archive, of course).
    – coxley
    Apr 12, 2013 at 15:17
  • Thanks for the info. When I started with Linux (19 years ago!), this was not the case. Good to know that this has changed.
    – Arne
    Apr 12, 2013 at 15:22
  • Anytime, I figured that was the case. Old habbits die hard. :)
    – coxley
    Apr 12, 2013 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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