web-dev-qa-db-ja.com

Ubuntu 16.10にScratch 2をインストールする方法。または17.04(64ビット)?

オフラインスクラッチ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パッケージ(dpkg-debやarなど)を作成するためのDebianツールがシステムに見つかりませんでした。

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パッケージ(dpkg-debやarなど)を作成するためのDebianツールがシステムに見つかりませんでした。

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-debおよびarでもう再生できないようです。

Ubuntu 16.10/17.04のオフラインScratch 2に関するヒントはありますか?

15
Martin

私はこの数時間遊んでいました。最初に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/dpkgに変更し、PATH変数を変更します。残念ながら、SudoはSudoなしではインストールできず、PATHをSudoに変更するのはそれほど簡単ではありません。

その後、不幸な納税者のポーランド語のフォーラムを見つけました。これは同様の問題を解決しています(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フォルダーに解凍しているため、最初の実行は少し長くなります。

Scratch 2 running on Ubuntu 17.04

20
Martin