`sudo apt-get update` /`sudo apt-get upgrade` 返回软件包错误

`sudo apt-get update` /`sudo apt-get upgrade` 返回软件包错误

我正在做apt-get updateapt-get upgradeapt-get upgrade卡住了 45 分钟,加载完成后返回了一个错误。

我读到的内容如下:

Archive:  /opt/android-studio-ide-141.2288178-linux.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /opt/android-studio-ide-141.2288178-linux.zip or
        /opt/android-studio-ide-141.2288178-linux.zip.zip, and cannot find /opt/android-studio-ide-141.2288178-linux.zip.ZIP, period.
find: `/opt/android-studio/': No such file or directory
find: `/opt/android-studio/': No such file or directory
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for gconf2 (3.2.6-0ubuntu2) ...
Processing triggers for libglib2.0-0:amd64 (2.40.2-0ubuntu1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/android-studio_4.12.0-ubuntu0_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我该如何解决??

答案1

安装后脚本会阻塞系统,在这种情况下,解决方案很简单,卸载后和卸载前脚本都没有问题。因此,通过以下方式删除软件包

sudo apt-get remove android-studio

我想说的是,还有 PPA。有更可靠的方法来安装 Android Studio。

sudo apt-get install ppa-purge
sudo ppa-purge ppa:paolorotolo/android-studio

相关内容