Dietpi: Cannot Install Oracle JDK 8

Created on 16 Jan 2018  Β·  21Comments  Β·  Source: MichaIng/DietPi

Creating a bug report/issue:

Required Information:

  • DietPi Version | 159
  • SBC Device :Orange Pi Zero
  • Power supply used : USB
  • SD card used Kingston 16GB
  • Distro | Linux DietPiOrange 3.4.113-sun8i #2 SMP PREEMPT Fri Mar 10 18:24:50 GMT 2017 armv7l GNU/Linux

Additional Information (if applicable):

  • Software title: Oracle JDK 8
  • Can this issue be replicated on a fresh installation of DietPi? yes

Expected behaviour:

I am trying to do automated Install of Dietpi on Orange Pi Zero, with node-red, Mosquitto and Blynk server set up to install automatically.
Here is the dietpi.txt file that I used:

#Modifications to /boot/* files, will not be saved when powered on.
#Please ensure you edit from the DietPi-RamDisk location /DietPi/*

#------------------------------------------------------------------------------------------------------
# D I E T - P I
# 1st run settings
# All settings below will be applied on the 1st boot of DietPi, ONCE.
#------------------------------------------------------------------------------------------------------
# >> Networking Options -----------------------------
#If both Ethernet and Wifi are enabled, Wifi will take priority and Ethernet will be disabled.
#   1=enabled
Ethernet_Enabled=0
Wifi_Enabled=1

#Enter your Wifi details below, if applicable (Case Sensitive).
Wifi_SSID=AaronsNetwork
Wifi_KEY=electricity
#   available | WPA-PSK / NONE | WEP=No longer supported
Wifi_KEYMGR=WPA-PSK

#Enter your Static Network details below, if applicable.
Use_Static=1
Static_IP=192.168.0.14
Static_Mask=255.255.255.0
Static_Gateway=192.168.0.33
Static_DNS=8.8.8.8

#Hostname
Hostname=DietPi

#Force ethernet speeds
#NB: This is mainly aimed towards Pine A64's which may have a HW issue that causes unstable 1Gbit link.
#   0=automatic speed | 10 = 10mbit, 100 = 100mbit etc
Ethernet_Force_Speed=0

# >> Misc Options -----------------------------------
#Size of dphys-swapfile to generate (MB)
#   0=Disabled | 1=auto (1GB-RAM = size) | 2+=manual
Swapfile_Size=1567

# >> Automation Options -----------------------------
#NB: Following options are only executed on 1st run of DietPi.

#Fully automate installation
#   1=Automated installation with no user inputs.
AUTO_Install_Enable=1

#Global Password to be applied for the system
#  Affects user "root" and "dietpi" login passwords, and, all software installed by dietpi-software, that requires a password
#  eg: MySQL, Transmission, Deluge etc.
#  WARN: Passwords with the any of the following characters are not supported: \"$
#  WARN: Do NOT change this entry, after 1st run setup of DietPi has been completed. It is always scraped by dietpi-software.
AUTO_Global_Password=dietpi

#DietPi-Software to automatically install. | requires AUTO_Install_Enable=1
#   For a list of software index's (ID's), run '/DietPi/dietpi/dietpi-software list'
#   No limit on number entires, add as many as you need and uncomment the line.
#   DietPi will automatically install all pre-reqs (eg: ALSA/XSERVER for desktops etc)
#   - Examples:
AUTO_DietpiSoftware_Install_ID=23   #will install Desktop LXDE
#AUTO_DietpiSoftware_Install_ID=74  #will install LAMP webserver stack
#AUTO_DietpiSoftware_Install_ID=44  #will install Bittorrent transmission

#AUTO_DietpiSoftware_Install_ID=123 #will install mosquitto
#AUTO_DietpiSoftware_Install_ID=122 #will install node-red
#AUTO_DietpiSoftware_Install_ID=131 #will install blynk server



#DietPi-Software Choice System
#SSH Server Selection:
#   0=none
#   -1=dropbear
#   -2=opensshserver
AUTO_DietpiSoftware_SSHServerIndex=-1

#File Server Selection:
#   0=none/manual
#   -1=proftp
#   -2=samba
AUTO_DietpiSoftware_FileServerIndex=-1

#Logging Mode Selection:
#   0=none/manual
#   -1=ramlog 1h clear
#   -2=ramlog 1h save clear
#   -3=logrotate + rsyslog
AUTO_DietpiSoftware_LoggingIndex=-1

#Webserver Preference Selection:
# NB: This will get ignored, if you have manually selected any WEBSERVER_Stacks.
#   0=Apache2
#   -1=Nginx
#   -2=Lighttpd
AUTO_DietpiSoftware_WebserverIndex=-2

#DietPi-Autostart | Requires AUTO_Install_Enable=1
#   After installation is completed, which program should the system boot to?
#   0=Console 7=Console+auto root login | 1=Kodi 2=Desktops (LXDE/MATE etc) 5=DietPi-Cloudshell 6=Uae4ARM (Fastboot) 8=Uae4ARM (standard boot) 9=dxx-rebirth
AUTO_AutoStartTarget=0

#Language/Regional settings | Requires AUTO_Install_Enable=1
#   Timezone eg: Europe/London America/New_York | Full list (TZ*): https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
AUTO_Timezone=America/Toronto
#   Locale eg: en_GB OR en_US etc. One entry ONLY. DietPi automatically applies .UTF-8 to your locale | Full list: cat /etc/locale.gen
AUTO_Locale=en_US
#   Keyboard Layout eg: gb us de fr
AUTO_KeyboardLayout=us

#Custom Script | Requires AUTO_Install_Enable=1
#   Allows you to automatically execute a custom script at the end of DietPi installation.
#   Option 1 = Copy your script to /boot/Automation_Custom_Script.sh and it will be executed automatically.
#   Option 2 = Host your script online, then use AUTO_CustomScriptURL=http://myweb.com/myscript.sh , it will be downloaded and executed automatically. | 0=disabled
AUTO_CustomScriptURL=0

#------------------------------------------------------------------------------------------------------
# D I E T - P I
# DietPi-Config settings.
#------------------------------------------------------------------------------------------------------
#RPi Hdmi output (if 0, sets tvservice -o and framebuffer 16x 16y 8z on boot, headless)
rpi_hdmi_output=1

#Cpu Governor | ondemand | powersave | performance | conservative
cpu_governor=ondemand
cpu_usage_throttle_up=50

#Limit the max cpu frequency (Mhz) for all cores. | Disabled=disabled | Useful for lowering temp/power usage on your device.
cpu_max_frequency=Disabled

#Limit the min cpu frequency (Mhz) for all cores. | Disabled=disabled | Useful for 1-wire correct support (eg. 480Mhz).
cpu_min_frequency=Disabled

#Min value 10000 microseconds (10ms)
cpu_ondemand_sampling_rate=25000

#sampling rate * down factor / 1000 = Miliseconds (40 = 1000ms when sampling rate is 25000)
cpu_ondemand_sampling_down_factor=80

#Samba Client Details (Used by DietPi-Config | Networking NAS | Samba Client)
SambaClient_ComputerName=computername
SambaClient_ShareName=sharename
SambaClient_Username=username
SambaClient_Password=password

#FTP Client Filesystem Mount (CurlFtpFs) (Used by DietPi-Config | Networking NAS | FTP Client)
curlftpfs_clientaddress=192.168.0.100
curlftpfs_clientusername=username
curlftpfs_clientpassword=password

#NFS Client Filesystem Mount (Used by DietPi-Config | Networking NAS | NFS Client)
nfsclient_ipaddress=

#Proxy settings | System-wide proxy settings. Use dietpi-config > networking options to apply.
proxy_enabled=0
proxy_address=MyProxyServer.com
proxy_port=8080
proxy_username=
proxy_password=

#Delay boot until network is established: 0=disabled | 1=10 second wait max (default) | 2=infinite wait
boot_wait_for_network=1

#DietPi check for updates (allows dietpi to check for updates on a daily basis and boot using a <1kb file download.)
dietpi_check_for_updates=1

#NTPD Update Mode: 0=disabled | 1=boot only | 2=boot + daily | 3=boot + hourly | 4=Daemon + Drift
ntpd_update_mode=2

#Wifi Hotspot
wifi_hotspot_ssid=DietPi-HotSpot
# - minimum of 8 characters
wifi_hotspot_key=dietpihotspot
wifi_hotspot_channel=3

#WiFi country code. 2 character value (eg GB US DE JP): https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
wifi_country_code=US

#Serial Console: Set to 1 if you require a serial console during 1st run of DietPi.
serial_console_enabled=0

#Soundcard
soundcard=rpi-bcm2835

#LCD Panel addon
lcdpanel=none

#Prefer IPversion (for: apt-get) | auto (let system decide) / ipv4 (force) / ipv6 (force) | eg: force IPv4 with prefer_ipversion=ipv4
prefer_ipversion=ipv4

#Apt mirrors which are applied to /etc/apt/sources.list | Values here will also be applied during 1st run setup
#   Raspbian = https://www.raspbian.org/RaspbianMirrors
#   Debian = https://www.debian.org/mirror/official#list
Apt_Raspbian_Mirror=https://www.mirrorservice.org/sites/archive.raspbian.org/raspbian
Apt_Debian_Mirror=http://ftp.debian.org/debian/

#NTPD mirror, applied to /etc/ntp.conf
#   For a full list, please see http://www.pool.ntp.org
#   Please remove the initial interger and full stop from the value (removing 0.). eg: debian.pool.ntp.org
NTPD_Mirror=debian.pool.ntp.org

#------------------------------------------------------------------------------------------------------
# D I E T - P I
# DietPi-Software settings.
#------------------------------------------------------------------------------------------------------
#Enter your EmonCMS.org write API key here. It will be applied automatically during EmonPi/Hub installation.
# - eg: dietpi_emonhub_apikey=b4dfmk2o203mmxx93a
dietpi_emonhub_apikey=

#VNC Server Options
dietpi_vncserver_width=1280
dietpi_vncserver_height=720
dietpi_vncserver_depth=16
dietpi_vncserver_display=1
dietpi_vncserver_shared_desktop=0

#Optional username for nextcloud admin account, default is admin. Applied during installation.
dietpi_nextcloud_username=admin

#------------------------------------------------------------------------------------------------------
# D I E T - P I
# Dev settings
#------------------------------------------------------------------------------------------------------
gitbranch=master
gitforkowner=Fourdee

#Forces a partition resize + expansion of rootfs on next boot. (0=disabled, 1=enabled)
fs_force_resize=0

# - Max size of rootfs resize (%)
rootfs_resize_limit=100

Actual behaviour:

here is output from console:

 DietPi-Software
─────────────────────────────────────────────────────
 Mode: Install software
 Please wait...

 Build-Essentials: common packages for compile
 [Info] Please wait...

 #               processing | D i e t  P i             #

 [Info] APT is processing, please wait...

Setting up oracle-java8-installer (8u151-1~webupd8~0) ...
Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
--2018-01-16 21:12:27--  http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz
Resolving download.oracle.com (download.oracle.com)... 184.28.42.81
Connecting to download.oracle.com (download.oracle.com)|184.28.42.81|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz [following]
--2018-01-16 21:12:28--  https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.93.179.190, 2600:140a:0:38c::2d3e, 2600:140a:0:382::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.93.179.190|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1516137268_e0b3788a4f0e0fd8b853b857e1c5db58 [following]
--2018-01-16 21:12:29--  http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1516137268_e0b3788a4f0e0fd8b853b857e1c5db58
Connecting to download.oracle.com (download.oracle.com)|184.28.42.81|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-01-16 21:12:30 ERROR 404: Not Found.

download failed
Oracle JDK 8 is NOT installed.
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)
 [Failed] The apt cache may be corrupt, apt mirror offline, or you have held broken packages. DietPi-Software will now exit.

 [Info] Apt Log:
Setting up oracle-java8-installer (8u151-1~webupd8~0) ...
Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
--2018-01-16 21:12:27--  http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz
Resolving download.oracle.com (download.oracle.com)... 184.28.42.81
Connecting to download.oracle.com (download.oracle.com)|184.28.42.81|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz [following]
--2018-01-16 21:12:28--  https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.93.179.190, 2600:140a:0:38c::2d3e, 2600:140a:0:382::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.93.179.190|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1516137268_e0b3788a4f0e0fd8b853b857e1c5db58 [following]
--2018-01-16 21:12:29--  http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1516137268_e0b3788a4f0e0fd8b853b857e1c5db58
Connecting to download.oracle.com (download.oracle.com)|184.28.42.81|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-01-16 21:12:30 ERROR 404: Not Found.

download failed
Oracle JDK 8 is NOT installed.
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)

 [Info] Please try:
 [Info] - Fixing apt package errors with 'apt-get install -f'
 [Info] - Change apt mirror: 'dietpi-config' > 'Networking: NAS/MISC' > 'Apt Mirror'
 [Info] - Clear and refresh apt 'apt-get update'
 [Info] - If problems persist, please create a Git ticket so DietPi can investigate the issue:
 - https://github.com/Fourdee/DietPi/issues

Steps to reproduce:

Flash image of dietpi for orange pi zero onto fresh SD card with my dietpi.txt file in root directory

Did you submit a dietpi-bugreport?

No

Extra details:

I am having a hard time getting dietpi installed on any of my SBC's with node-red and Mosquitto as well as local Blynk Server, it seems there are errors all along and spend the whole day with no luck...Does anyone have a simple foolproof script to get node-red, mosquitto and blynk server installed onto dietpi??

Bug Not a DietPi issue Solution available

Most helpful comment

@aaro668 @gotttlieb
Jep, I face exactly the same on following the official installation guide of the PPA maintainers: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

Thus it's no DietPi issue and should be addressed to http://www.webupd8.org/.

I just made a quick search for alternatives:

  • Debian offers a JDK package: https://packages.debian.org/de/stretch/default-jdk
  • As can be seen, this is Java 8 on Stretch, but just Java 7 on Jessie. This might have been the reason to use the PPA?
  • But via backports, JDK 8 can be installed: https://packages.debian.org/de/jessie-backports/openjdk-8-jdk
  • This is quite easy, as DietPi includes the backports repository by default: apt install -t jessie-backports openjdk-8-jdk
  • But before you start this, be sure to purge the other installer from your system first: If dietpi-software does not list it to uninstall (because of installation break), then do: dpkg -P oracle-java8-installer && apt-get autoremove --purge I use dpkg -P in the front, as apt purge will break on error because of the half/failed configuration of this package before even trying to purge it πŸ˜†.
  • I don't have some Java project to test with, but installation works flawlessly on my Jessie testing system.

@Fourdee
Was my guess right, that using the mentioned PPA is because of outdated Java version on Debian repo? As mentioned, we can use jessie-backports, even version 9 is available on buster+stretch-backports: https://packages.debian.org/de/stretch-backports/openjdk-9-jdk. Or was the reason indeed another?

All 21 comments

@aaro668

  • We use this PPA: https://launchpad.net/~webupd8team and installation breaks before we do any configuration/adjustments.
  • The installer tries to download the SDK from oracle.com, but gets redirected several times and finally: HTTP request sent, awaiting response... 404 Not Found breaks it.
  • Thus doesn't look like a DietPi issue so far.
  • https://www.oracle.com/index.html got some heavy optical rework since the last time I saw it. Maybe also the internal download paths were changed, causing the issue. In this case we would need to wait for a fix by β€œWebUpd8” team. Although I don't see open bugs on their launchpad or a possibility to add a bug report: https://launchpad.net/~webupd8team
  • I will try to replicate tomorrow.

@MichaIng
OK, so this is basically either a problem with Oracle download page or WebUpd8?
Are there alternative ways to getting these 3 packages installed in dietpi? (node-red, blynk server and mosquitto)

I tried installing only blynk server tonight, and got the error again:
image

and here is the log:

[Info] Apt Log:
Setting up oracle-java8-installer (8u151-1~webupd8~0) ...
Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
--2018-01-16 21:21:14--  http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz
Resolving download.oracle.com (download.oracle.com)... 23.56.202.80
Connecting to download.oracle.com (download.oracle.com)|23.56.202.80|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz [following]
--2018-01-16 21:21:20--  https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.93.179.190, 2600:140a:0:38c::2d3e, 2600:140a:0:382::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.93.179.190|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1516155801_dfe8adb3289e8695a230f94b67ffb4b1 [following]
--2018-01-16 21:21:21--  http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1516155801_dfe8adb3289e8695a230f94b67ffb4b1
Connecting to download.oracle.com (download.oracle.com)|23.56.202.80|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-01-16 21:21:23 ERROR 404: Not Found.

download failed
Oracle JDK 8 is NOT installed.
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)

 [Info] Please try:
 [Info] - Fixing apt package errors with 'apt-get install -f'
 [Info] - Change apt mirror: 'dietpi-config' > 'Networking: NAS/MISC' > 'Apt Mirror'
 [Info] - Clear and refresh apt 'apt-get update'
 [Info] - If problems persist, please create a Git ticket so DietPi can investigate the issue:
 - https://github.com/Fourdee/DietPi/issues

Being that this is software that is supposed to be optimized to run on dietpi and should "just work" then I consider this a dietpi issue??

@aaro668

OK, so this is basically either a problem with Oracle download page or WebUpd8?

Yes looks like, especially if other apt installations work fine. Temporarily we can try to find an alternative source for Java 8 SDK, e.g. Raspbian had it's own package included.

But I need to sleep now. Will try to replicate tomorrow and see if I find a solution.

I'am in the same situation
``` DietPi-Software
─────────────────────────────────────────────────────
Mode: Install software
Please wait...

ALSA: linux sound system
[Info] Please wait...

# processing | D i e t P i #

[Info] APT is processing, please wait...

Configurando oracle-java8-installer (8u151-1~webupd8~0) ...
Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
--2018-01-17 20:07:20-- http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz
Resolviendo download.oracle.com (download.oracle.com)... 104.104.142.192
Conectando con download.oracle.com (download.oracle.com)[104.104.142.192]:80... conectado.
PeticiΓ³n HTTP enviada, esperando respuesta... 302 Moved Temporarily
LocalizaciΓ³n: https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz [siguiendo]
--2018-01-17 20:07:20-- https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz
Resolviendo edelivery.oracle.com (edelivery.oracle.com)... 104.83.55.184, 2a02:26f0:129:397::2d3e, 2a02:26f0:129:392::2d3e
Conectando con edelivery.oracle.com (edelivery.oracle.com)[104.83.55.184]:443... conectado.
PeticiΓ³n HTTP enviada, esperando respuesta... 302 Moved Temporarily
LocalizaciΓ³n: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1516216160_7cbc4fca3f0596208f6c147e4c69b986 [siguiendo]
--2018-01-17 20:07:20-- http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1516216160_7cbc4fca3f0596208f6c147e4c69b986
Conectando con download.oracle.com (download.oracle.com)[104.104.142.192]:80... conectado.
PeticiΓ³n HTTP enviada, esperando respuesta... 404 Not Found
2018-01-17 20:07:21 ERROR 404: Not Found.

download failed
Oracle JDK 8 is NOT installed.
dpkg: error al procesar el paquete oracle-java8-installer (--configure):
el subproceso instalado el script post-installation devolviΓ³ el cΓ³digo de salida de error 1
Se encontraron errores al procesar:
oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
[Failed] The apt cache may be corrupt, apt mirror offline, or you have held broken packages. DietPi-Software will now exit.

[Info] Apt Log:
Configurando oracle-java8-installer (8u151-1~webupd8~0) ...
Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
--2018-01-17 20:07:20-- http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz
Resolviendo download.oracle.com (download.oracle.com)... 104.104.142.192
Conectando con download.oracle.com (download.oracle.com)[104.104.142.192]:80... conectado.
PeticiΓ³n HTTP enviada, esperando respuesta... 302 Moved Temporarily
LocalizaciΓ³n: https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz [siguiendo]
--2018-01-17 20:07:20-- https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz
Resolviendo edelivery.oracle.com (edelivery.oracle.com)... 104.83.55.184, 2a02:26f0:129:397::2d3e, 2a02:26f0:129:392::2d3e
Conectando con edelivery.oracle.com (edelivery.oracle.com)[104.83.55.184]:443... conectado.
PeticiΓ³n HTTP enviada, esperando respuesta... 302 Moved Temporarily
LocalizaciΓ³n: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1516216160_7cbc4fca3f0596208f6c147e4c69b986 [siguiendo]
--2018-01-17 20:07:20-- http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-arm32-vfp-hflt.tar.gz?AuthParam=1516216160_7cbc4fca3f0596208f6c147e4c69b986
Conectando con download.oracle.com (download.oracle.com)[104.104.142.192]:80... conectado.
PeticiΓ³n HTTP enviada, esperando respuesta... 404 Not Found
2018-01-17 20:07:21 ERROR 404: Not Found.

download failed
Oracle JDK 8 is NOT installed.
dpkg: error al procesar el paquete oracle-java8-installer (--configure):
el subproceso instalado el script post-installation devolviΓ³ el cΓ³digo de salida de error 1
Se encontraron errores al procesar:
oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)```

Already tryed to chanfe the APT Mirror

@aaro668 @gotttlieb
Jep, I face exactly the same on following the official installation guide of the PPA maintainers: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

Thus it's no DietPi issue and should be addressed to http://www.webupd8.org/.

I just made a quick search for alternatives:

  • Debian offers a JDK package: https://packages.debian.org/de/stretch/default-jdk
  • As can be seen, this is Java 8 on Stretch, but just Java 7 on Jessie. This might have been the reason to use the PPA?
  • But via backports, JDK 8 can be installed: https://packages.debian.org/de/jessie-backports/openjdk-8-jdk
  • This is quite easy, as DietPi includes the backports repository by default: apt install -t jessie-backports openjdk-8-jdk
  • But before you start this, be sure to purge the other installer from your system first: If dietpi-software does not list it to uninstall (because of installation break), then do: dpkg -P oracle-java8-installer && apt-get autoremove --purge I use dpkg -P in the front, as apt purge will break on error because of the half/failed configuration of this package before even trying to purge it πŸ˜†.
  • I don't have some Java project to test with, but installation works flawlessly on my Jessie testing system.

@Fourdee
Was my guess right, that using the mentioned PPA is because of outdated Java version on Debian repo? As mentioned, we can use jessie-backports, even version 9 is available on buster+stretch-backports: https://packages.debian.org/de/stretch-backports/openjdk-9-jdk. Or was the reason indeed another?

@MichaIng

Was my guess right, that using the mentioned PPA is because of outdated Java version on Debian repo? As mentioned, we can use jessie-backports, even version 9 is available on buster+stretch-backports: https://packages.debian.org/de/stretch-backports/openjdk-9-jdk. Or was the reason indeed another?

We use the PPA to install Oracle JDK, which I believe was proprietary. Open JDK would not of been.
The reason for this, was me assuming the proprietary software should perform better/faster, than the open source version, however turns out I may of been wrong:
https://stackoverflow.com/a/38685948

So yep, using openjdk via APT sounds like a better solution.

@MichaIng
Ok, so when I try to install the software (blynk server) from dietpi-software, I got the error....
Should I install the backport(apt install -t jessie-backports openjdk-8-jdk) before installing the blynk server via dietpi-software and it should then work without the error?

just a FYI:
I am also getting this error on fresh install of dietpi on OPi zero:
`
DietPi-Software
─────────────────────────────────────────────────────
Mode: Install software
Please wait...

Build-Essentials: common packages for compile
[Info] Please wait...

# processing | D i e t P i #

[Info] APT is processing, please wait...

Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 16105 files and directories currently installed.)
Preparing to unpack .../libc6_2.19-18+deb8u10_armhf.deb ...

LD_LIBRARY_PATH contains the traditional /lib directory,
but not the multiarch directory /lib/arm-linux-gnueabihf.
It is not safe to upgrade the C library in this situation;
please remove the /lib/directory from LD_LIBRARY_PATH and
try again.

dpkg: error processing archive /var/cache/apt/archives/libc6_2.19-18+deb8u10_armhf.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.19-18+deb8u10_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
[Failed] The apt cache may be corrupt, apt mirror offline, or you have held broken packages. DietPi-Software will now exit.

[Info] Apt Log:
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 16105 files and directories currently installed.)
Preparing to unpack .../libc6_2.19-18+deb8u10_armhf.deb ...

LD_LIBRARY_PATH contains the traditional /lib directory,
but not the multiarch directory /lib/arm-linux-gnueabihf.
It is not safe to upgrade the C library in this situation;
please remove the /lib/directory from LD_LIBRARY_PATH and
try again.

dpkg: error processing archive /var/cache/apt/archives/libc6_2.19-18+deb8u10_armhf.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/libc6_2.19-18+deb8u10_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

[Info] Please try:
[Info] - Fixing apt package errors with 'apt-get install -f'
[Info] - Change apt mirror: 'dietpi-config' > 'Networking: NAS/MISC' > 'Apt Mirror'
[Info] - Clear and refresh apt 'apt-get update'
[Info] - If problems persist, please create a Git ticket so DietPi can investigate the issue:

I am able to fix it like this:

echo $LD_LIBRARY_PATH
unset LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
ldconfig -v

And then running dietpi-software again

@Fourdee
Ah yes I see. The current issues with the Oracle JDK PPA might be temporary, but as of your link, it might be at least not worse, to switch to OpenJDK and it would be easier to handle/install.

@aaro668
Ah yeah sorry, was not thinking too far. You can install OpenJDK by the method I provided, but of course DietPi-Software, when choosing dependant software, still expects Oracle JDK to be installed/tries to do this. We need to adjust this behaviour. This can be done for v6.0 release, but we decided to only provide this major update as new image: https://github.com/Fourdee/DietPi/issues/1355
So depending on how urgent your request is and how willing you are to flash the new image, once released, I can start to implement the adjustment and then provide the hopefully not too vast changes you need to do to dietpi-software manually as temporary fix.
€: LD_LIBRARY_PATH: Ah yes, another known issue with current release, already fixed with v6.0

@MichaIng

I am basically on a quest to try and find the best/fastest way for setting up a minimal OS on an Orange Pi Zero, running Blynk Server, Node-red and Mosquitto MQTT broker.
This is a handy/cheap/small and flexible board with ethernet and wifi connectivity,I think the potential for IOT applications is enormous.

I have a few boards here that I am just playing around with to try and find the best way to get these 3 softwares running.
Once you get V6 released please do let me know, then I can test the image on a board here and see how it goes!

Thanks for all your help!

@aaro668
This is great news. As we made huge/deep changes with v6.0, intensive testing/willing testers are highly appreciated.

I made a first PR for the Oracle JDK => OpenJDK switch: https://github.com/Fourdee/DietPi/pull/1405
Most of our software seem to get the related binaries/lib paths by themself, e.g. via which java, but testing is needed.

  • On Blynk installation I just faced another issue which might be related to v6.0 changes:
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/onoff/node_modules/epoll/.node-gyp/9.4.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/onoff/node_modules/epoll/.node-gyp"
  • Bizarre as root of course has full root permissions... However manual npm install -g onoff worked well and allowed me to finish installation afterwards.
  • But Blynk server does not start up because of not recent enough Java version, if I get the log right. Sadly seems to be not solved for Jessie that easy. Even the backport is on Java 8u131, where on Stretch it's 8u151
  • We'll see how to solve it.

@MichaIng

I have figured out how to install the BlynkServer manually:

1 Download this file to "/mnt/dietpi_userdata/downloads": https://github.com/blynkkk/blynk-server/releases/download/v0.29.7/server-0.29.7-java8.jar

2 Run these commands:

sudo tar zxvf jdk-8u161-linux-arm32-vfp-hflt.tar.gz -C /opt
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_161/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_161/bin/java 1
sudo update-alternatives --config javac
sudo update-alternatives --config java

3 Make a directory: /mnt/dietpi_userdata/Blynk

cd /mnt/dietpi_userdata/Blynk
wget "https://github.com/blynkkk/blynk-server/releases/download/v0.29.7/server-0.29.7-java8.jar"
copy mail.properties and server.properties files into "/mnt/dietpi_userdata/Blynk/" directory

4 Set up to run at boot:

sudo nano /etc/rc.local

Add the following command mentioned before "exit"
java -jar /mnt/dietpi_userdata/Blynk/server-0.29.7-java8.jar -dataFolder /mnt/dietpi_userdata/Blynk -serverConfig /mnt/dietpi_userdata/Blynk/server.properties -mailConfig /mnt/dietpi_userdata/Blynk/mail.properties &

sudo reboot

when it has rebooted the blynk server should be running

@aaro668
Many thanks for sharing. Yes we somehow missed to switch to the Java 8 Blynk version. I also got it running now, also there was a typo, leading to en empty server.properties, where the actually intention is to pull it also from Blynk github. Fixed with: https://github.com/Fourdee/DietPi/pull/1406

Service runs, web ui opens at https://<yourURL/IP>:9443/admin. I just cannot access configuration page, see PR.

@MichaIng
I cannot access config page either, but I don't really need it, and have never used so I am not sure if it is even needed?
Possibly get someone involved that has experience with local Blynk server to help with this.

Hi @MichaIng first of all thanks for your efforts!
To me it's happen the same, I was able to intall the OpenJDK, but for me it's failing the instalation of packages via dietpi-software as you mention.
~The thing is, whe can know witch dependencies are needed? I take a look in the Forum but they are not listed.~ See it listed in you PR, cool.
Thanks!

@gotttlieb

@aaro668
Yeah, I guess the config page error is not related to Java anymore. I just asked at their github page. Someone else had the same error on some sub page of config and there the info was, that web ui is under rework: https://github.com/blynkkk/blynk-server/issues/658#issuecomment-358778423

OK, I manage to get something "working" ( at least no errors apeared in my sistem)

Next Snipet is Tested in Odroid XU 4, use under your own risk.
First i executed as @MichaIng advised:
dpkg -P oracle-java8-installer && apt-get autoremove --purge
And replaced next lines are replaced in the /DietPi/dietpi/dietpi-software file.
Remove Line number before pasting. DO NOT COPYPAST WITHOUT EDIT, DO A BACKUP FIRST

8237 # - Raspbian 8238 if (( $HW_MODEL < 10 )); then 8239 8240 AGI openjdk-8-jdk 8241 8242 # - Debian. Add repo 8243 else 8244 #Add Manual install of Jdk 8245 apt install -t jessie-backports openjdk-8-jdk 8246 AGI openjdk-8-jdk 8247 8248 fi

@gotttlieb
Ah sorry forgot, that the G_ commands/variables are not yet available in v159 πŸ˜….
So this should work then as expected on every v159 (or lower) system, replacing lines 8237 until 8258:

            if (( $DISTRO == 3 )); then

                cat << _EOF_ > /etc/apt/preferences.d/99-dietpi-openjdk-8-jdk
Package: openjdk-8-jdk
Pin: release a=jessie-backports
Pin-Priority: 990
_EOF_

                AGI openjdk-8-jdk -t jessie-backports

            else

                AGI openjdk-8-jdk

            fi
  • AGI is just a wrapper of apt-get install with some automation options, so apt install and AGI is doubled in your snippet.
  • Important on Jessie ($DISTRO == 3 means Debian/Raspbian Jessie) is that it pulls the package and it's dependencies from backports: -t jessie-backports
  • The preferences.d addition allows apt(-get) (dist-)upgrade to pull upgrades from backports as well. But actually I doubt, that the Debian maintainers will give JDK 8 an upgrade on Jessie backports anymore, as it stuck at u131, where current is u161 .
  • No check for $HW_MODEL necessary anymore, as we now handle it similar for all machines.
  • If something got messed up with the file, just replace it by the raw one from current master branch (v159): https://github.com/Fourdee/DietPi/raw/master/dietpi/dietpi-software

Mark as closed, as fixed with v6.0 and manual fix for v159 provided.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oshank picture oshank  Β·  3Comments

1021683053 picture 1021683053  Β·  3Comments

Invictaz picture Invictaz  Β·  3Comments

and09 picture and09  Β·  3Comments

mok-liee picture mok-liee  Β·  3Comments