Repository navigation
Closed
Description
Installing the Oracle Java 8 JDK update 111 no longer works on WSL since the change from update 101 to 111. It seems that dmesg is necessary, but not supported on WSL.
This is the truncated result once the JDK was downloaded from Oracle:
Download done.
Removing outdated cached downloads...
mv: cannot move 'jdk1.8.0_111' to 'java-8-oracle': Permission denied
dpkg: error processing package oracle-java8-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up gsfonts (1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1) ...
dmesg: read kernel buffer failed: Function not implemented
/bin/df: /proc/sys/fs/binfmt_misc: Operation not permitted
Setting up x11-common (1:7.7+13ubuntu3) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Setting up xfonts-encodings (1:1.0.4-2) ...
Setting up xfonts-utils (1:7.7+3) ...
Setting up gsfonts-x11 (0.24) ...
dpkg: dependency problems prevent configuration of oracle-java8-set-default:
oracle-java8-set-default depends on oracle-java8-installer; however:
Package oracle-java8-installer is not configured yet.
dpkg: error processing package oracle-java8-set-default (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu3) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for systemd (229-4ubuntu8) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
oracle-java8-installer
oracle-java8-set-default
E: Sub-process /usr/bin/dpkg returned an error code (1)
Windows Build: Windows 10 Build 14959
Reproduction steps:
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install -y oracle-java8-installer
Reacted by Ali Lahijani, Roman Cherepanov, T, sasan azizi, Donald Pipowitch, Bohdan Yurov and Rafal W.
Reacted by Per Arneng
Metadata
Metadata
Assignees
Labels
No labels
Activity
therealkenc commentedon Nov 4, 2016
Setting aside a permissions problem on
/dev/kmsg, relevant strace looks like:This is one of those (many) cases where stubbing functionality in WSL would go a long way. Even if all WSL's
/dev/kmesgcontained was the following string it would be a start, and we could see what Oracle was grepping for.benhillis commentedon Nov 4, 2016
On an internal build I was able to follow the reproduction steps without any install failures... Interesting.
therealkenc - I like your idea of adding something to /dev/kmsg's buffer so it's not empty. I'll take a look at that since it's probably a strange case for it to be completely empty as it usually is on WSL.
therealkenc commentedon Nov 5, 2016
I didn't do an Oracle install, but
sudo dmesgdefinitely fails with thedmesg: read kernel buffer failed: Function not implementedfor me.benhillis commentedon Nov 5, 2016
therealkenc - Awesome thanks for the clarification. I really like your idea of prepopulating the /dev/kmsg buffer with something (since usually init and other deamons would have written a bunch of stuff to it).
therealkenc commentedon Nov 5, 2016
Awesome. Please note the perms while you're there. Should be 644.
hdave commentedon Nov 23, 2016
Your repro steps worked for me on Win10 build 14965 prerelease 161104-1700.
On another related point -- Maybe I'm coming into this wrong, but I also have installed Oracle Java 8 from within Windows. As an experiment I tried from within WSL to set my JAVA_HOME to that directory added JAVA_HOME/bin to my path and aliased java='java.exe' -- and so far it seems to work. Is there some reason we can't redirect WSL to the Windows installation of Java? Could this be a work-around for some people? I realize that update-alternatives thinks no java is installed....
stehufntdev commentedon Apr 13, 2017
As a workaround to the dmesg failure, please first write something to /dev/kmsg (e.g.
echo foo > /dev/kmsg). As mentioned above, dmesg always expects there to be some data in /dev/kmsg which isn't always the case on WSL.Marking this as a bug so we can track fixing the behavior difference.
spoiledsport commentedon Apr 13, 2017
Actually there is no workaround. First of all, after making the change, dmesg doesn't print what is expected of it. Second, this only works for the current window. After you exit bash and start it again, you are back to the same issue.
This worked in previous version of WSL. It actually showed the correct output.
stehufntdev commentedon Apr 14, 2017
For the workaround you should be able to always write sometime to /dev/kmsg (e.g. put the line above in bash.rc). Init and other components log through /dev/kmsg so something probably changed in the configuration. Realistically dmesg shouldn't fail this case but it probably never happens in practice on native Linux.
This is marked as a bug so we will look at fixing it for insider builds.
daiconrad commentedon Apr 15, 2017
hdave (@hdave) What do you mean when you say "so far it seems to work"? If I'm in a BoW directory, I get:
OTOH, it does work in a directory under /mnt/c
Ebola-Chan-bot commentedon Dec 12, 2017
Stephen Hufnagel (@stehufntdev)
sudo echo foo > /dev/kmsgreturns-bash: /dev/kmsg: Permission deniedBrian-Perkins commentedon Dec 12, 2017
You can do something like: echo foo > sudo tee /dev/kmsg
therealkenc commentedon Jan 12, 2018
Ben Hillis (@benhillis) in Nov 2016
Pinging because doing so inexplicably seems to work.
almdrx commentedon Feb 13, 2018
Here from #1886
Just my 2 cents...
dmesg, returnsdmesg: read kernel buffer failed: Function not implementedecho foo > /dev/kmsgreturnsbash: /dev/kmsg: Permission deniedHowever if passed as a quoted command ...
therealkenc commentedon Feb 20, 2018
Unfortunately, this doesn't seem to take. You can get over the hard
lseek()fail by putting anything in the buffer, but it appears that the WSL device prepends cruft to the output, as opposed to a well formedkmsg:This is why
dmesgalways looks something like this in WSL, even after daemons have written to it:Same
echotest works on Real Linux™, natch.Given that(edit,correction:rsyslogdis also inoperable per #534rsyslogdlimps, only soft fails remaining), this pretty much blocks the ability for daemons (which give up the terminal) to provide any kind of feedback to the user.therealkenc commentedon Jul 13, 2018
Support for
/dev/kmsgwas added in 17655.kenorb commentedon Oct 4, 2018
After upgrading WSL, it seems to work.