在 Ubuntu 中安装 Scratch 2

在 Ubuntu 中安装 Scratch 2

一直试图在 ubuntu 上下载 scratch 2,但是我到了这一步,我不知道该怎么做:

getlibs -1 libhal-storage.so.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  lib32z1 lib32ncurses5 lib32bz2-1.0

E: Package 'ia32-libs' has no installation candidate
getopt: unrecognized option '-1'
No match for libhal-storage.so.1
No packages to install

我该怎么办???谢谢

答案1

然后执行,安装lib32z1,,,答案已经在错误消息中了lib32ncurses5lib32bz2-1.0

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

答案2

在此处输入图片描述

安装Scratch 2 离线版本有必要:

  1. 安装 Adob​​e Air
  2. 使用 Adob​​e Air 安装 Scrath 2

但安装 Adob​​e Air 是一场噩梦。

幸运的是我找到了这里(页面最后部分)一个可以完美运行并完成所有操作的小脚本18.04.2 LTS为我。

所以解决方案是:

  1. 创建此脚本

     #!/bin/bash
    
     if [ $EUID -ne 0 ]; then
        echo "To be launched with sudo" 1>&2
        exit 1
     fi
    
     echo ">> Remove previous versions..."
     apt-get -y --purge remove adobeair
     rm -rf /opt/adobe-air-sdk
     rm /usr/share/applications/Scratch2.desktop
    
     CHKBITS=`uname -m`
     if [ $CHKBITS = "x86_64" ]; then
         echo ">> Installing dependencies 32bit..."
         apt-get -q update
         apt-get -q -y 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
     fi
    
     echo ">> Link Gnome libraries..."
     ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0
     ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 /usr/lib/libgnome-keyring.so.0.2.0
    
     echo ">> Download Adobe Air SDK..."
     wget -q http://airdownload.adobe.com/air/lin/download/2.6/AdobeAIRSDK.tbz2
     mkdir /opt/adobe-air-sdk
     tar jxf AdobeAIRSDK.tbz2 -C /opt/adobe-air-sdk
    
     echo ">> Download Air runtime/SDK from Archlinux..."
     wget -q https://aur.archlinux.org/cgit/aur.git/snapshot/adobe-air.tar.gz
     tar xvf adobe-air.tar.gz -C /opt/adobe-air-sdk
     chmod +x /opt/adobe-air-sdk/adobe-air/adobe-air
    
     echo ">> Download Scratch2..."
     mkdir /opt/adobe-air-sdk/scratch
     wget -q -O /opt/adobe-air-sdk/scratch/scratch.air https://scratch.mit.edu/scratchr2/static/sa/Scratch-456.0.4.air
    
     echo ">> Creating launcher..."
     unzip -j /opt/adobe-air-sdk/scratch/scratch.air icons/AppIcon128.png -d /opt/adobe-air-sdk/scratch/
     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.air
     Icon=/opt/adobe-air-sdk/scratch/AppIcon128.png
     Terminal=false
     Name=Scratch 2
     Comment=Programación visual con Scatch 2.0
     Categories=Application;Education;Development;ComputerScience;
     MimeType=application/x-scratch-project
     _EOF_
     chmod +x /usr/share/applications/Scratch2.desktop
    
     echo ">> the END!"
    
  2. 使用以下命令执行该脚本sudo

  3. 现在应该安装它了,只需搜索刮擦 2在您的应用程序中并启动它!

在此处输入图片描述

相关内容