我正在尝试将 Heroku 本地安装到我的 Ubuntu 14.04 LTS 中。
但我收到了这个错误:
The following NEW packages will be installed:
heroku
0 upgraded, 1 newly installed, 0 to remove and 198 not upgraded.
1 not fully installed or removed.
Need to get 14,6 MB of archives.
After this operation, 0 B of additional disk space will be used.
Fetched 14,6 MB in 3s (4.497 kB/s)
Selecting previously unselected package heroku.
(Reading database ... 333239 files and directories currently installed.)
Preparing to unpack .../heroku_5.6.8-1_amd64.deb ...
Unpacking heroku (5.6.8-1) ...
Setting up oracle-java8-installer (8u92+8u91arm-2~really8u91~webupd8~0) ...
Installing from local file /var/cache/oracle-jdk8-installer/jdk-8u91-linux-x64.tar.gz
Removing outdated cached downloads...
mv: cannot move ‘jdk1.8.0_91’ to ‘java-8-oracle/jdk1.8.0_91’: Directory not empty
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up heroku (5.6.8-1) ...
Errors were encountered while processing:
oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
有人遇到过这个问题吗?如何解决?目前,我正在考虑更改这两个目录的所有者和组,但我不知道这样做意味着什么。
感谢您的任何建议!
限量版
我忘了提到这两个目录的结构:
6952928 drwxr-xr-x 9 uucp 143 4096 iul 22 19:41 java-8-oracle
6832129 drwxr-xr-x 8 uucp 143 4096 apr 1 2016 jdk1.8.0_91
这对我来说看起来很奇怪。尤其是uucp 143
。如果您需要我提供更多信息,请询问,因为我对 Linux(或类似的东西)不太熟悉。
再次感谢!
LE2:
按照@Zanna 的想法,我重命名了这两个目录,然后再次运行安装程序。没有成功,因为我收到以下错误:
heroku is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 198 not upgraded.
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] Y
Setting up oracle-java8-installer (8u92+8u91arm-2~really8u91~webupd8~0) ...
Installing from local file /var/cache/oracle-jdk8-installer/jdk-8u91-linux-x64.tar.gz
Removing outdated cached downloads...
install: cannot stat ‘javaws-wrapper.sh’: No such file or directory
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
LE3
是的,我正在使用 ppa。我试过了这些清除软件包的步骤:我安装了 ppa-purge,然后运行了第二条命令来删除它。我收到此错误:
# First I installed ppa-purge, and at the end, I got the same error: E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get install ppa-purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
aptitude aptitude-common libboost-iostreams1.54.0 libcwidget3 libept1.4.12
Suggested packages:
aptitude-doc-en aptitude-doc tasksel debtags libcwidget-dev
The following NEW packages will be installed:
aptitude aptitude-common libboost-iostreams1.54.0 libcwidget3 libept1.4.12
ppa-purge
0 upgraded, 6 newly installed, 0 to remove and 197 not upgraded.
1 not fully installed or removed.
Need to get 2.555 kB of archives.
After this operation, 10,7 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://ro.archive.ubuntu.com/ubuntu/ trusty-updates/main libboost-iostreams1.54.0 amd64 1.54.0-4ubuntu3.1 [29,0 kB]
Get:2 http://ro.archive.ubuntu.com/ubuntu/ trusty/main libept1.4.12 amd64 1.0.12 [142 kB]
Get:3 http://ro.archive.ubuntu.com/ubuntu/ trusty/main aptitude-common all 0.6.8.2-1ubuntu4 [700 kB]
Get:4 http://ro.archive.ubuntu.com/ubuntu/ trusty/main libcwidget3 amd64 0.5.16-3.5ubuntu1 [307 kB]
Get:5 http://ro.archive.ubuntu.com/ubuntu/ trusty/main aptitude amd64 0.6.8.2-1ubuntu4 [1.371 kB]
Get:6 http://ro.archive.ubuntu.com/ubuntu/ trusty/universe ppa-purge all 0.2.8+bzr57 [5.704 B]
Fetched 2.555 kB in 3s (670 kB/s)
Selecting previously unselected package libboost-iostreams1.54.0:amd64.
(Reading database ... 333239 files and directories currently installed.)
Preparing to unpack .../libboost-iostreams1.54.0_1.54.0-4ubuntu3.1_amd64.deb ...
Unpacking libboost-iostreams1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Selecting previously unselected package libept1.4.12:amd64.
Preparing to unpack .../libept1.4.12_1.0.12_amd64.deb ...
Unpacking libept1.4.12:amd64 (1.0.12) ...
Selecting previously unselected package aptitude-common.
Preparing to unpack .../aptitude-common_0.6.8.2-1ubuntu4_all.deb ...
Unpacking aptitude-common (0.6.8.2-1ubuntu4) ...
Selecting previously unselected package libcwidget3.
Preparing to unpack .../libcwidget3_0.5.16-3.5ubuntu1_amd64.deb ...
Unpacking libcwidget3 (0.5.16-3.5ubuntu1) ...
Selecting previously unselected package aptitude.
Preparing to unpack .../aptitude_0.6.8.2-1ubuntu4_amd64.deb ...
Unpacking aptitude (0.6.8.2-1ubuntu4) ...
Selecting previously unselected package ppa-purge.
Preparing to unpack .../ppa-purge_0.2.8+bzr57_all.deb ...
Unpacking ppa-purge (0.2.8+bzr57) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up oracle-java8-installer (8u92+8u91arm-2~really8u91~webupd8~0) ...
Installing from local file /var/cache/oracle-jdk8-installer/jdk-8u91-linux-x64.tar.gz
Removing outdated cached downloads...
mv: cannot move ‘jdk1.8.0_91’ to ‘java-8-oracle/jdk1.8.0_91’: Directory not empty
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up libboost-iostreams1.54.0:amd64 (1.54.0-4ubuntu3.1) ...
Setting up libept1.4.12:amd64 (1.0.12) ...
Setting up aptitude-common (0.6.8.2-1ubuntu4) ...
Setting up libcwidget3 (0.5.16-3.5ubuntu1) ...
Setting up aptitude (0.6.8.2-1ubuntu4) ...
update-alternatives: using /usr/bin/aptitude-curses to provide /usr/bin/aptitude (aptitude) in auto mode
Setting up ppa-purge (0.2.8+bzr57) ...
Processing triggers for libc-bin (2.19-0ubuntu6.9) ...
Errors were encountered while processing:
oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
# Here I tried to purge the package
sudo ppa-purge ppa:webupd8team/java
Updating packages lists
PPA to be removed: webupd8team java
Warning: Could not find package list for PPA: webupd8team java
答案1
感谢@Zanna 的帮助,我解决了这个问题。由于原帖下方的评论区有很多回复,我再说一遍我的问题是什么:
我试图安装 Heroku CLI,但无法安装,因为最后出现了一个错误:
mv: cannot move ‘jdk1.8.0_91’ to ‘java-8-oracle/jdk1.8.0_91’: Directory not empty
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up heroku (5.6.8-1) ...
Errors were encountered while processing:
oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
因此,修复方法是使用两个简单的终端命令(依次清除导致问题的 oracle-java8-installer),如下所示这很好帖子推荐:
sudo dpkg -P oracle-java8-installer
sudo apt-get -f install
然后我再次尝试安装 Heroku CLI,并且效果很好。
如果您需要重新安装oracle-java8-installer
,则需要再次添加webupd8team ppa
:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
我必须提到,我能够安装 Heroku CLI 而无需重新安装oracle-java8-installer
。
现在,如果您想赞成这个答案,您需要感谢@Zanna,而不是我的研究。
祝大家圣诞快乐:)