4

I'm trying to install Heroku locally into my Ubuntu 14.04 LTS.

But I'm getting this error:

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)

Anyone encountered this problem? And how to fix it? For the moment I was thinking to change the owner and the group for these two directories, but I don't know the implications.

Thank you for any suggestions!

LE

I forgot to mention the structure of these two directories:

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

which looks strange to me. Especially that uucp 143. If you need me to provide more info, please ask, as I'm not so advanced in Linux (or such).

Again, thanks!

LE2:

After following @Zanna 's idea, I renamed those two directories, and I ran the installer again. Unsuccessfull, as I get the following error:

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

Yes, I'm using a ppa. I tried these steps to purge the package: I installed ppa-purge, then I ran the second command to remove it. I got this error:

# 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

And now I can't understand why this warning, as both directories are in place. Additionaly, I got this error window too.

  • the cause of that error is most likely that there is already a directory named jdk1.8.0_91 at that location which is not empty. mv refuses to overwrite the directory in that case (by design). Perhaps you could rename the existing directory temporarily, to see if that fixes things without causing new problems. I do not know what your underlying issue is, but I wouldn't recommend any chown commands based on the current information. You should tell us what you have been doing that might have caused problems. – Zanna Dec 22 '16 at 12:01
  • Yes I realise that you are not executing it, however, you can still avoid that particular error by renaming java-8-oracle/jdk1.8.0_91... I do not know the full path, but you can do mv /path/to/java-8-oracle/jdk1.8.0_91{,.bak} and then try running the installation again. (correct the /path/to part with the real path) but I don't know what side effects there could be - you might have to rename it back to correct new problems that arise. And this may not be your root problem – Zanna Dec 22 '16 at 12:12
  • @Zanna Ok, I'll try to rename it and re-install again. The same happened, some time ago, when I tried to install other software based on java, like PhpStorm, or to un-install Chrome. The error was identical. I'll let you know if will work or not. – Dan Costinel Dec 22 '16 at 12:16
  • @Zanna Done. But by renaming the dirs, I couldn't solve the problem... – Dan Costinel Dec 22 '16 at 12:23
  • @Zanna Can you please take a look again to my problem? Thank you! – Dan Costinel Dec 23 '16 at 12:24
  • Thanks for pinging me! OK, looking at your new error, it seems heroku is fine, and the problem is the oracle-java8-installer package. Are you using the webupda8 team PPA? I suggest trying to purge the ppa if so, or purge oracle-java8-installer. Try running sudo apt install -f afterwards. If you can't manage to get rid of it, please update us again – Zanna Dec 23 '16 at 12:40
  • @Zanna Please check my LE3. – Dan Costinel Dec 23 '16 at 17:05
  • 1
  • @Zanna Yes. I was finally able to uninstall oracle-java8-installer (without getting any error). My last question: should I reinstall it? This is a dependency for some clients, dunno, like PhpStorm, Chromium, even the heroku package I wanted to install initialy? Thank you for support. – Dan Costinel Dec 24 '16 at 07:15
  • can't those packages use OpenJDK instead? if not, go ahead and try re-adding the PPA, hopefully it will work out, and if not you know how to fix it :S When you're done, you can write an answer to your own question :D – Zanna Dec 24 '16 at 07:21
  • @Zanna I'll write an answer only if you don't want to post one. And please do, as I'll accept it as the right one. – Dan Costinel Dec 24 '16 at 07:44
  • Thanks a lot, but your answer will be much better than mine as you know in detail what you did to solve your complex problem :) please ping me when you answer so I can give you an upvote. – Zanna Dec 24 '16 at 07:48
  • @Zanna Done... :) – Dan Costinel Dec 24 '16 at 09:17

1 Answers1

3

Thanks to @Zanna's help, I was able to fix my problem. And because there are a lot of replies in the comment area below the original post, I'll say once more what my problem was:

I was trying to install Heroku CLI, but I couldn't, as an error came up at the end:

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)

So the fix was by using two simple terminal commands (which in turn purges the oracle-java8-installer, which caused the problem), as this nice post recommends:

sudo dpkg -P oracle-java8-installer
sudo apt-get -f install

Then I tried again to install Heroku CLI and it worked like a charm.

If you then need to reinstall oracle-java8-installer, you'll need to add again the webupd8team ppa:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

I must mention that I was able to install Heroku CLI without reinstalling oracle-java8-installer.

Now, if you think upvoting this answer, you'll need to thank to @Zanna, more than to my researches.

Merry Christmas all :)

  • well done for solving your problem and thanks for posting a great clear answer :) Merry Christmas – Zanna Dec 24 '16 at 09:47