-2

I'm in desperate need help installing p5.js and making it work on my linux kubuntu os for school. I tried to look for videos on youtube on how to install p5.js on linux but failed to find anything and that fully explain how to install it.

I found this: https://github.com/processing/p5.js-editor/issues/250 but I struggle to understand what the poster meant to do "chmod +x" I tried to google it and got lost in it.

I'm new to linux os and have only been able to install programs using Sudo apt-get install or install programs through "app" store called Discover that came on Kubuntu.

I have no idea how to install programs using the zip-method. I downloaded the p5.js zip and unzipped it on the download folder but nothing happened... can someone please help me and provide a fully noob-proof instructions on how to get p5.js running on linux?

Thanks!

9
  • From your link: "download the Linux version, unzip, chmod +x the executable then you can run" – DK Bose Sep 30 '19 at 23:53
  • uhmm.... I know! but I don't know what the person meant by "chmod +x" – squirtle Sep 30 '19 at 23:56
  • if you man chmod you'll see the [reference] manual page for chmod which will tell you "chmod - change file mode bits", ie. it adds execute (+x) permissions to the file that follows the command. If you're unsure, my suggestion would be man chmod to help you better understand what is required, ie. view manual page for the command. School is for learning, and you learn more if not spoon-fed (you can't learn by copy/paste) – guiverc Oct 1 '19 at 0:00
  • the hmod +x is to give the downloaded file execute permission so you can run it. it can also be done by right clicking on the file go to properties then the permissions tab and click the box that says allow executeing file as program – wraith3690 001 Oct 1 '19 at 0:01
  • 1
    in the file folder there is a file called p5 that is the executable so if you do it from the term it should be "chmod +x p5" just drop the "-linux" as there is no file called "p5-linux" – wraith3690 001 Oct 1 '19 at 0:37
1

Once you've extracted the zip file, you'll need to give yourself permission to execute the executable file. The way to do this through the terminal is by running chmod +x <name of file>, or in this case, chmod +x p5. If you're not comfortable with that, Kubuntu's file manager has a way to do this through a GUI:

From there you can run it by either double-clicking the file, or running ./<name of executable file> in a terminal. If it doesn't run at first, running it through a terminal will allow you to see the program's output. I should also note that this program seems to depend on the libgconf-2-4 package, which I had to install manually.

At this point, you're done, but finding the file and manually executing every time you want to open it will quickly get tedious, so I would recommend moving the program to a more permanent location and adding a desktop file. A typical place to put unpackaged programs like this is /opt. Assuming all the files needed to run the program are in one folder, you can move the folder to /opt using sudo mv ~/Downloads/<name of folder> /opt/<name of program>.

Once the program is in a permanent location, we can use kmenuedit to create a desktop file. Hit alt+f2 to pull up krunner and run kmenuedit from there. Hit alt+f2 to pull up krunner and run kmenuedit from there.

Select the "Development" category, then "New Item...", then enter the Item name. The only field you need to fill from there is the command field, in which you would put /opt/<name of program>/<name of executable file>. Save the changes, and quit kmenuedit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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