최근에 다음 오류가 발생했을 때 Debian 10 VPS에 snapd를 설치하려고 했습니다.
Setting up jdk1.8 (1.8.0271-1) ...
Unpacking JAR files...
tools.jar...
Error: Could not open input file: /usr/java/jdk1.8.0_271-amd64/lib/tools.pack
plugin.jar...
Error: Could not open input file: /usr/java/jdk1.8.0_271-amd64/jre/lib/plugin.pack
javaws.jar...
Error: Could not open input file: /usr/java/jdk1.8.0_271-amd64/jre/lib/javaws.pack
deploy.jar...
Error: Could not open input file: /usr/java/jdk1.8.0_271-amd64/jre/lib/deploy.pack
rt.jar...
Error: Could not open input file: /usr/java/jdk1.8.0_271-amd64/jre/lib/rt.pack
jsse.jar...
Error: Could not open input file: /usr/java/jdk1.8.0_271-amd64/jre/lib/jsse.pack
charsets.jar...
Error: Could not open input file: /usr/java/jdk1.8.0_271-amd64/jre/lib/charsets.pack
localedata.jar...
Error: Could not open input file: /usr/java/jdk1.8.0_271-amd64/jre/lib/ext/localedata.pack
update-alternatives: error: alternative jar can't be slave of java: it is a master alternative
dpkg: error processing package jdk1.8 (--configure):
installed jdk1.8 package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
jdk1.8
E: Sub-process /usr/bin/dpkg returned an error code (1)
업데이트 옵션이나 Java 설치에 문제가 있는 것 같습니다. 힌트를 찾아보았지만 alternative jar can't be slave of java: it is a master alternative
이해할 수 없습니다. 패키지 업데이트를 시도했지만 그것도 영향을 미치지 않는 것 같습니다.
귀하의 도움에 진심으로 감사드립니다.
답변1
해결책:
alternative jar can't be slave of java: it is a master alternative
다음에 Java를 추가해야 합니다 update-alternatives
.
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk1.8.0_271-amd64/bin/java 100
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk1.8.0_271-amd64/bin/javac 100 \
--slave "/usr/bin/jar" "jar" "/usr/java/jdk1.8.0_271/bin/jar"
다음 오류를 해결하십시오.
dpkg: error processing package jdk1.8 (--configure):
installed jdk1.8 package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
jdk1.8
E: Sub-process /usr/bin/dpkg returned an error code (1)