我尝试通过运行命令来安装 glut sudo apt-get install freeglut3-dev
,但是 apt-get 没有尝试安装 glut,而是尝试安装 Java,我记得几天前曾尝试安装 Java。
错误信息:
Reading package lists... Done
Building dependency tree
Reading state information... Done
freeglut3-dev is already the newest version (2.8.1-3).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up oracle-java7-installer (7u80+7u60arm-0~webupd8~1) ...
Downloading Oracle Java 7...
--2017-06-05 22:27:09-- http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 2.127.246.99, 2.127.246.88
Connecting to download.oracle.com (download.oracle.com)|2.127.246.99|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz [following]
--2017-06-05 22:27:09-- https://edelivery.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 2a02:26f0:6000:188::2d3e, 2a02:26f0:6000:182::2d3e, 72.246.145.28
Connecting to edelivery.oracle.com (edelivery.oracle.com)|2a02:26f0:6000:188::2d3e|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1496698149_caee32bd2be689be6e287d0dc2327b9b [following]
--2017-06-05 22:27:09-- http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1496698149_caee32bd2be689be6e287d0dc2327b9b
Connecting to download.oracle.com (download.oracle.com)|2.127.246.99|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-06-05 22:27:11 ERROR 404: Not Found.
download failed
Oracle JDK 7 is NOT installed.
dpkg: error processing package oracle-java7-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
更新
sudo apt-get autoremove
也失败并显示错误消息
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up oracle-java7-installer (7u80+7u60arm-0~webupd8~1) ...
Downloading Oracle Java 7...
--2017-06-05 22:40:46-- http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 90.223.189.171, 90.223.189.136
Connecting to download.oracle.com (download.oracle.com)|90.223.189.171|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz [following]
--2017-06-05 22:40:46-- https://edelivery.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 2a02:26f0:a1:29d::2d3e, 2a02:26f0:a1:2a0::2d3e, 72.246.145.28
Connecting to edelivery.oracle.com (edelivery.oracle.com)|2a02:26f0:a1:29d::2d3e|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1496698966_f1174438ea33637e096efb0850659a23 [following]
--2017-06-05 22:40:46-- http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1496698966_f1174438ea33637e096efb0850659a23
Connecting to download.oracle.com (download.oracle.com)|90.223.189.171|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-06-05 22:40:46 ERROR 404: Not Found.
download failed
Oracle JDK 7 is NOT installed.
dpkg: error processing package oracle-java7-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
解決答案。
sudo apt-get --force-yes remove oracle-java7-installer
线索是1 not fully installed or removed.
答案2
您发布的输出表明您问题的包已安装。它显示了您已安装的版本。
正在读取软件包列表...完成 构建依赖关系树 正在读取状态信息...完成 freeglut3-dev 已经是最新版本 (2.8.1-3)。 0 表示升级,0 表示全新安装,0 表示删除,0 表示不升级。 1 未完全安装或删除。 此操作后将使用0B的额外磁盘空间。
我突出显示了您输出的条目。您安装的版本是最新版本。
您无法安装已经安装的东西。您将得到已安装的输出。
您提到您尝试在其他时间安装 Java。您看到的其他消息是系统尝试清理失败的安装。
它处理您尝试安装的新软件包。它还会继续处理队列中的其他问题和错误。您可以通过取消您建议不尝试安装的内容来处理队列中的错误,它会自行执行。
运行以下命令来检查您尝试安装 Java 时使用的命令:
$ history | egrep " install "
现在运行此命令来取消那些失败的安装:
$ sudo apt remove --purge [package]
清除失败的安装后,您可以运行sudo apt autoremove
来执行清理。
您还可以使用以下命令删除 Webup8 安装程序包:
$ sudo add-apt-repository --remove ppa:webupd8team/java
您可以通过运行以下命令轻松安装 Java:
$ sudo apt install default-jdk
这将为您的 Ubuntu 版本安装最新版本的 Openjdk。
或者,您可以通过仔细执行安装步骤来安装 Oracle 的 Jave,安装步骤如下:
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer
我使用了版本7因为这就是您尝试安装的版本。您可以根据要安装的版本使用 7、8 或 9。
如果您安装了多个 Java 版本,您可以通过运行以下命令来选择要激活哪个版本:
$ sudo update-alternatives --config java
重要的
手动运行安装时,还必须手动执行已安装软件包的更新和升级命令。更新命令会更新存储库站点。
命令如下:
$ sudo apt update
$ sudo apt upgrade
$ sudo apt full-upgrade
这些命令将确保您拥有从存储库安装的软件包的最新版本的依赖项。