1

How to install Scratch 2 on Ubuntu 16.10. or 17.04 (64bit)?

Have followed the code by Martin but permission is denied and no such file exists messages appear.

The first bit of code seems to have worked so I have the scratch.air file

Any help appreciated - code I've tried is below :

Create launcher:

$ cat << _EOF_ > /usr/share/applications/Scratch2.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec=/opt/adobe-air-sdk/adobe-air/adobe-air /opt/adobe-air-sdk/scratch/Scratch-456.0.1.air
Icon=/opt/adobe-air-sdk/scratch/scratch.png
Terminal=false
Name=Scratch 2
Comment=Programming system and content development tool
Categories=Application;Education;Development;ComputerScience;
MimeType=application/x-scratch-project
_EOF_

$ chmod +x /usr/share/applications/Scratch2.desktop
Charles Green
  • 21,859

2 Answers2

2

Normally, the /usr/share/applications directory is owned by root - you won't be able to cat to a file there without sudo. You can either modify the here-doc command to

cat << _EOF_ | sudo tee /usr/share/applications/Scratch2.desktop

or just use an editor to create the .desktop file instead

sudoedit /usr/share/applications/Scratch2.desktop

FWIW I don't believe .desktop files need execute permission, but if they did you would need sudo to change that as well

sudo chmod +x /usr/share/applications/Scratch2.desktop
steeldriver
  • 142,475
1

Thank you so much for this answer. It worked perfectly. I'm posting this as an answer since it is clear-er for me/others to see how easy it is.

As stated in the comments, I replaced the line provided in the previous answer for the original command given then I just copied the rest of the command. Thanks again... It worked beautifully. I also changed the Scratch version to download. I first installed the version(number 456.0.1) but the updated just downloads and does not installs it.... I checked the current version -456.0.4- on the website and I changed it accordingly to all the commands to install it.

cat << _EOF_ | sudo tee /usr/share/applications/Scratch2.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec=/opt/adobe-air-sdk/adobe-air/adobe-air /opt/adobe-air-sdk/scratch/Scratch-456.0.4.air
Icon=/opt/adobe-air-sdk/scratch/scratch.png
Terminal=false
Name=Scratch 2
Comment=Programming system and content development tool
Categories=Application;Education;Development;ComputerScience;
MimeType=application/x-scratch-project
_EOF_