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

我需要在Ubuntu 16.10 / 17.04上使用离线Scratch 2安装Adobe Air.Air在Linux上不受支持多年,因此有几种解决方法。 一个为我工作到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-debar都已安装:

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

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

 [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)。

Install.log记录

 [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的任何提示?

这几个小时我一直在玩。 首先,我尝试跟踪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无法处理前一个链接。 这可以通过在~/air/bin/dpkg放置的包装脚本修复,并在运行Adobe Air Application Installer之前更改PATH变量。 不幸的是,没有sudo就无法安装Scratch,而改变sudo的PATH并不容易。

然后我找到了一个不愉快的纳税人的波兰论坛,它正在解决类似的问题(他们需要从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~/.appdata/edu.media.mit.Scratch2Editor文件夹。

在Ubuntu 17.04上运行的Scratch 2