如何在Ubuntu 16.10上安装Scratch 2。或17.04(64位)?


15

我需要在具有离线Scratch 2的Ubuntu 16.10 / 17.04上安装Adobe Air。很多年来,Linux不支持Air。因此,有几种解决方法。直到Ubuntu 16.04都对我有用(使用Air二进制安装程序):

# install i386 necessary libraries
$ sudo apt-get install libgtk2.0-0:i386 libstdc++6:i386 libxml2:i386 libxslt1.1:i386 libcanberra-gtk-module:i386 gtk2-engines-murrine:i386 libqt4-qt3support:i386 libgnome-keyring0:i386 libnss-mdns:i386 libnss3:i386
# install keyring
$ sudo apt-get install libgnome-keyring0:i386
# make keyring visible for Air
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/libgnome-keyring.so.0.2.0 
# download Adobe Air installer
$ wget  http://airdownload.adobe.com/air/lin/download/2.6/AdobeAIRInstaller.bin
# run it
$ sudo chmod +x AdobeAIRInstaller.bin
$ sudo ./AdobeAIRInstaller.bin

但在16.10 / 17.4上以安装程序错误结束:

无法安装Adobe AIR。在系统上找不到用于创建deb软件包的Debian工具(例如dpkg-deb或ar)。

这显然是错误的错误消息,dpkg-deb并且ar都已安装:

$ dpkg-deb --version
Debian 'dpkg-deb' package management program version 1.18.10 (amd64).
$ ar --version
GNU ar (GNU Binutils for Ubuntu) 2.28

来自的Adobe Air安装日志文件 /root/.appdata/Adobe/AIR/Logs/Install.log

[setup:2506][INFO] Runtime Installer begin with version 2.6.0.19170 on Linux x86
[setup:2506][INFO] Commandline is: 
[setup:2506][INFO] No installed runtime detected
[setup:2506][INFO] Relaunching with elevation
[setup:2506][INFO] Launching subprocess with commandline /tmp/air.hp19kU/setup -ei
[setup:2525][INFO] Runtime Installer begin with version 2.6.0.19170 on Linux x86
[setup:2525][INFO] Commandline is: -stdio /tmp/air.KWo9tt/channel -ei
[setup:2525][INFO] No installed runtime detected
[setup:2525][INFO] Starting silent runtime install. Installing runtime version 2.6.0.19170
[setup:2525][INFO] Session detected: GNOME
[setup:2525][ERR] Error occurred during rpm create operation; beginning rollback: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="dpkg-query: package 'adobe-certs' is not installed and no information is available;Use dpkg --info (= dpkg-deb --info) to examine archive files,;and dpkg --contents (= dpkg-deb --contents) to list their contents.Could not run the command : ar" errorID=5031]
[setup:2525][INFO] Rollback complete
[setup:2525][ERR] Exiting due to error: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="dpkg-query: package 'adobe-certs' is not installed and no information is available;Use dpkg --info (= dpkg-deb --info) to examine archive files,;and dpkg --contents (= dpkg-deb --contents) to list their contents.Could not run the command : ar" errorID=5031]
[setup:2525][ERR] Runtime Installer end with exit code 7
[setup:2506][ERR] Exiting due to error: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="dpkg-query: package 'adobe-certs' is not installed and no information is available;Use dpkg --info (= dpkg-deb --info) to examine archive files,;and dpkg --contents (= dpkg-deb --contents) to list their contents.Could not run the command : ar" errorID=5031]
[setup:2506][ERR] Runtime Installer end with exit code 7

因此,我找到了另一种通过deb软件包安装Adobe Air的方法(我以前不知道):

$ wget http://airdownload.adobe.com/air/lin/download/2.6/adobeair.deb
$ sudo dpkg -i adobeair.deb

和瞧!Adobe Air已安装在Ubuntu 16.10 / 17.04上。
现在安装Scratch 2。

# Find the latest Scratch AIR file link from https://scratch.mit.edu/scratch2download/
$ wget https://scratch.mit.edu/scratchr2/static/sa/Scratch-456.0.1.air
$ sudo Adobe\ AIR\ Application\ Installer ./Scratch-456.0.1.air 

同样的错误:

无法安装Adobe AIR。在系统上找不到用于创建deb软件包的Debian工具(例如dpkg-deb或ar)。

安装日志

[Adobe AIR Application Installer:3197][INFO] Application Installer begin with version 2.6.0.19170 on Linux x86
[Adobe AIR Application Installer:3197][INFO] Commandline is: 
[Adobe AIR Application Installer:3197][INFO] Installed runtime (2.6.0.19170) located at /opt/Adobe AIR
[Adobe AIR Application Installer:3197][INFO] Unpackaging file:///home/administrator/Downloads/Scratch-456.0.1.air to /tmp/FlashTmp.LSCkv7
[Adobe AIR Application Installer:3197][INFO] Application signature verified
[Adobe AIR Application Installer:3197][INFO] Unpackaging/validation complete
[Adobe AIR Application Installer:3197][INFO] No app located for appID 'edu.media.mit.Scratch2Editor' and pubID ''
[Adobe AIR Application Installer:3197][INFO] Converting unpackaged application to a native installation package in /tmp/FlashTmp.RJSwfW
[Adobe AIR Application Installer:3197][ERR] Native installation package creation failed: [ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2 text="Unhandled exception Error: Error creating the package Could not run the command : ar" errorID=5031]
[Adobe AIR Application Installer:3197][ERR] Application Installer end with exit code 7

就像一个没有维护Adobe AIR的容貌不能起到新的dpkg-debar了。

关于Ubuntu 16.10 / 17.04上的Scratch 2脱机的任何提示吗?


1
谢谢!按照这些说明,我能够在17.04上运行Scratch 2.0。但是,我无法使启动器代码正常工作。我在Ubuntu 17.04的安装上找不到/ usr / bin / applications,但能够找到/ usr / share / applications。我选择了这条路,但对我没有用。我安装了Alacarte,并用它为Scratch创建了启动器。我使用/ opt / adobe-air-sdk / adobe-air / adobe-air /opt/adobe-air-sdk/scratch/Scratch-456.0.1.air作为命令,一切正常。
Ubuntu 17.04上的Scratch 2.0 '04年

对不起,我是罪魁祸首。在脚本中花了太长时间,最后我打错了字。我将对该教程进行编辑。没错,全局启动器的文件夹位于/usr/share/applications/,本地启动器位于~/.local/share/applications/。我需要全局桌面,因为桌面上有更多用户。按下超级键(winkey)并键入“ Scratch”后,即可使用全局启动器。非常感谢您的测试!
马丁

Answers:


19

这两个小时我一直在玩。首先,我尝试跟踪Adobe Air Application Installer和查找内部发生的情况。

$ sudo strace -s 500 -t -o air_scratch.txt Adobe\ AIR/Versions/1.0/Adobe\ AIR\ Application\ Installer ~/Downloads/Scratch-456.0.1.air 

我发现这一行:

read(18, "dpkg-deb: error: treewalk root /tmp/FlashTmp.3TWnKI/build/DEBIAN is not a directory\n", 4096) = 84

似乎新手dpkg无法像上一个那样处理链接。可以通过在运行Adobe Air Application Installer之前将包装器脚本放置到~/air/bin/dpkgPATH变量并更改变量来解决此问题。不幸的是,如果没有sudo,则无法安装Scratch,并且更改PATHsudo并不容易。

然后我发现了一个波兰纳税人论坛,他们不满纳税人正在解决类似的问题(他们需要在Debian / Ubuntu上运行财政部的一些Air应用程序):https : //forum.dug.ne​​t.pl/viewtopic.php?pid = 310108

在这个论坛的深处,我发现了一些提示,如何在Ubuntu 16.10 / 17.04上运行Scratch 2(甚至没有adobeair.deb安装)。

这是我的最终可行解决方案,已通过全新安装测试。

# install necesary i386 libraries
$ sudo apt-get install libgtk2.0-0:i386 libstdc++6:i386 libxml2:i386 libxslt1.1:i386 libcanberra-gtk-module:i386 gtk2-engines-murrine:i386 libqt4-qt3support:i386 libgnome-keyring0:i386 libnss-mdns:i386 libnss3:i386

# make keyring visible for Adobe Air
$ sudo ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0
$ sudo ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/libgnome-keyring.so.0.2.0

# Download Adobe Air
cd ~/Downloads
wget http://airdownload.adobe.com/air/lin/download/2.6/AdobeAIRSDK.tbz2
$ sudo mkdir /opt/adobe-air-sdk
$ sudo tar jxf AdobeAIRSDK.tbz2 -C /opt/adobe-air-sdk

# Download Air runtime/SDK from Archlinux
wget https://aur.archlinux.org/cgit/aur.git/snapshot/adobe-air.tar.gz
$ sudo tar xvf adobe-air.tar.gz -C /opt/adobe-air-sdk
$ sudo chmod +x /opt/adobe-air-sdk/adobe-air/adobe-air

# Get actual scratch file URL from https://scratch.mit.edu/scratch2download/
$ sudo mkdir /opt/adobe-air-sdk/scratch
wget https://scratch.mit.edu/scratchr2/static/sa/Scratch-456.0.1.air
$ sudo cp Scratch-456.0.1.air /opt/adobe-air-sdk/scratch/
cp Scratch-456.0.1.air /tmp/
cd /tmp/
unzip /tmp/Scratch-456.0.1.air
$ sudo cp /tmp/icons/AppIcon128.png /opt/adobe-air-sdk/scratch/scratch.png

创建启动器:

$ 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

就是这样。由于Air正在将Scratch 2应用程序解压缩到~/.appdata/edu.media.mit.Scratch2Editor文件夹中,因此首次运行时间会更长一些。

在Ubuntu 17.04上运行的Scratch 2


3
绝对是老板!做得好!

在必须运行“ dpkg --add-architecture i386 && apt-get update”之前,我遇到了“ libnss-mdns:i386”错误。它对我没有影响
Mohamed EL HABIB

做得好!但是,除非删除了该$标记,否则该代码无效。除非我关注这篇文章(askubuntu.com/questions/956389/…),否则创建启动器也会失败。我希望这对其他人有帮助。注意:我还是Ubuntu的新手。
Mohammad ElNesr

1
$是有来表示一个命令,你必须运行(而不是输出)
丹Abrey

有用!即使在现在,仍在Debian测试/测试中。谢谢!
miguev
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.