module not found: org.scala-sbt#sbt;1.1.6 - scala

I installed SBT via terminal with following commands:
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install sbt
on my Ubuntu 18.04 and with java version:
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.18.04.1-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)
The installation was successful but when I tried to start SBT via terminal, then I've got
https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/1.1.6/ivys/ivy.xml
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;1.1.6: not found
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.pom
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.1.6/sbt-1.1.6.jar
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.1.6/ivys/ivy.xml
Server access Error: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/1.1.6/ivys/ivy.xml
What is wrong?
Update
developer#monad:~$ sudo apt-get purge openjdk-8-jdk java-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
openjdk-11-jre-headless : Depends: ca-certificates-java but it is not going to be installed
Depends: java-common (>= 0.28) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
List of installed java version:
developer#monad:~$ update-java-alternatives --list
java-1.11.0-openjdk-amd64 1101 /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64
Update 2
sudo apt-get install ca-certificates-java
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates-java is already the newest version (20170930ubuntu1).
ca-certificates-java set to manually installed.
The following packages were automatically installed and are no longer required:
libice-dev libsm-dev libxt-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

The root cause is a conflict between openjdk-11-jdk (which is default in Ubuntu 18.04) and sbt packages settings. It has already been fixed in Debian and will be included in Ubuntu shortly. Meanwhile the simplest workaround is to demote your java to version 8. Other solutions employing ca-certificates-java are much more complicated.
First remove conflicting packages:
sudo apt-get remove --purge openjdk* java-common default-jdk
sudo apt-get remove --purge sbt
sudo apt-get autoremove --purge
Check weather you successfully removed all related packages by:
sudo update-alternatives --config java
The system shall prompt you there is no Java available to config, otherwise this workaround fails.
Then reinstall required packages:
sudo apt-get install openjdk-8-jdk sbt
Test by:
sbt compile

Problem is java-certificates so you need to run these commands:
Reinstall JDK
$ sudo apt-get purge openjdk-8-jdk java-common
$ sudo apt-get install openjdk-8-jdk
Run sbt
$ sbt

I would recommend you install Java/Scala/SBT totally independent from the OS packages. It does not matter (or should not matter!) for a developer which specific version of Java was installed by apt-get, yum or whatever.
From the developer's perspective, it may even make sense to test your application under several versions of Java. I've seen this situation before: "it works" under Java 1.8.x but "it fails" under Java 1.8.y.
So, from a developers, perspective, you would be interested on quickly swithing versions of Java, so that you can quickly make sure it works properly under those several different versions, no matter which specific version is installed on your specific version of the OS.
If you liked the idea, this is how it works:
Download manually all JDK versions you like and uncompress them under a given folder under your home folder, say: $HOME/tools. I have a script which automagically installs a certain version of the JDK for you: https://github.com/frgomes/bash-scripts/blob/master/scripts/user-install/install-java.sh
Adjust environment variables in a virtualenv-like fashion. It's easier than you think and you dont't even need virtualenv. All you need is to source a shell script which runs at login time which defines JAVA_HOME, pointing to a given version of Java, under your $HOME/tools. This is an example: https://github.com/frgomes/bash-scripts/blob/master/bashrc-virtualenvs/j8s12/bin/postactivate
Install Scala and SBT versions by hand, or using my automated script at https://github.com/frgomes/bash-scripts/blob/master/scripts/user-install/install-scala.sh

This fixed it for me.
sudo update-ca-certificates -f

In my case, I solved it by removing .m2, .ivy & .sbt.
Next time I executed sbt, it fixed everything.
I believe I broke sbt when I was playing with the cached dependencies or something else.

Related

Problam with apt-get install

I'm using ubuntu 16.04 and last week I try to install some virtual machine on my computer but I failed to do it.
Now when I try to install any program from the apt-get install I got this text:
sudo apt-get install build-essential git libssl-dev
[sudo] password for eliya:
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
git is already the newest version (1:2.7.4-0ubuntu1.5).
libssl-dev is already the newest version (1.0.2g-1ubuntu4.13).
The following packages were automatically installed and are no longer required:
libavdevice-ffmpeg56 linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic
linux-image-4.4.0-134-generic linux-image-extra-4.4.0-134-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 103 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 virtualbox-ext-pack (5.1.38-0ubuntu1.16.04.1) ...
removing old virtualbox extension packs
virtualbox-ext-pack: downloading: http://download.virtualbox.org/virtualbox/5.1.38/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack
The file will be downloaded into /usr/share/virtualbox-ext-pack
License accepted.
0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to install "/usr/share/virtualbox-ext-pack/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack"
VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: World writable: '/usr'
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager
VBoxManage: error: Context: "RTEXITCODE handleExtPack(HandlerArg*)" at line 1201 of file VBoxManageMisc.cpp
Hash mismatch Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack: expected e93d87b0f5de50369baca0a48082236b947df5b922ffd0233c0fa92c1206defd, or wrong accept-license key, removing the file.
dpkg: error processing package virtualbox-ext-pack (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
virtualbox-ext-pack
E: Sub-process /usr/bin/dpkg returned an error code (1)
And now i can't install anything because this problam.
Thank you
1.Reconfigure Package Database
sudo dpkg --configure -a
2.force install
sudo apt-get install -f
Then try again installing virtualbox

Could not retrieve sbt 0.13.9 on fresh Ubuntu install

After a fresh install of Ubuntu 15.04, I attempted to install and run SBT using the instructions from www.scala-sbt.org. It installed fine, but when I run it for the first time, I get a bunch of errors:
~$ sbt
...
:::: ERRORS
Server access Error: java.lang.RuntimeException: Unexpected error:
java.security.InvalidAlgorithmParameterException: the trustAnchors
parameter must be non-empty
url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.9/sbt-0.13.9.jar
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.9: not found
Error during sbt execution: Error retrieving required libraries
(see /root/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.9
What is going wrong?
I have had same problem with xubuntu 15.10. I installed package ca-cacert:
sudo apt-get install ca-cacert
It solved this problem.
After a bit of debugging, I found that the cacerts file is missing from the latest version of OpenJDK.
All I had to do was copy the cacerts file from /etc/ssl/certs/java/cacerts from a working computer to my new workstation, and it worked fine.
I've made my file available at this link.

SBT install failure with aptitude on Ubuntu 14.04

I receive several errors when I attempt to install sbt on Ubuntu via aptitude with the instructions from the scala-sbt homepage:
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-get update
sudo apt-get install sbt
http://www.scala-sbt.org/0.13/tutorial/Installing-sbt-on-Linux.html
First I get a package validation error and then a segmentation fault.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
sbt
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 1,041 kB of archives.
After this operation, 1,224 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
sbt
Install these packages without verification? [y/N] y
E: Method https has died unexpectedly!
E: Sub-process https received a segmentation fault.
EDIT:
I can browse the mirror fine without any cert errors.
Confirming which mirror it's using with apt-cache.
$ sudo apt-cache policy sbt
sbt:
Installed: (none)
Candidate: 0.13.7
Version table:
0.13.7 0
500 https://dl.bintray.com/sbt/debian/ Packages
0.13.6 0
500 https://dl.bintray.com/sbt/debian/ Packages
0.13.5 0
500 https://dl.bintray.com/sbt/debian/ Packages
0.13.2 0
500 https://dl.bintray.com/sbt/debian/ Packages
0.13.1-0.1-build-001 0
500 https://dl.bintray.com/sbt/debian/ Packages
0.13.0-0.1-build-001 0
500 https://dl.bintray.com/sbt/debian/ Packages
0.12.4-0.1-build-001 0
500 https://dl.bintray.com/sbt/debian/ Packages
EDIT 2: I ended up just downloading the package manually and installing it with dpkg.
There are related answers which lead me to this solution:
wget https://dl.bintray.com/sbt/debian/sbt-0.13.7.deb
sudo dpkg -i sbt-0.13.7.deb
P.S. I think that officially documented way does not work because they didn't provide the public key used by apt to authenticate packages.
P.P.S. After some research I've found that this issue is more related to the apt package, there are many reports about this error at bugs.launchpad.net. So, while it's still an issue that sbt didn't provide public key, but it shouldn't cause this error. I hope canonical will resolve this soon.
Related:
Install sbt on ubuntu [closed]
Install Java Scala and SBT on Debian (useless pain in the ass)
Manual install is also available:
http://www.scala-sbt.org/0.13/tutorial/Manual-Installation.html
Also, as a temporary workaround, you could use HTTP repository address instead of HTTPS.
Just open file /etc/apt/sources.list.d/sbt.list and replace
deb https://dl.bintray.com/sbt/debian /
with
deb http://dl.bintray.com/sbt/debian /

Error "the PGXS Makefile cannot be found" when installing PostGis on Debian

I am in the process of installing PostGis over psql on a Debian machine (actually crunchbang).
I have completed the following steps:
$ wget http://download.osgeo.org/postgis/source/postgis-2.0.3.tar.gz
$ tar xzf postgis-2.0.3.tar.gz
$ cd postgis-2.0.3
$ ./configure
On the final step I get the following error:
configure: error: the PGXS Makefile /usr/lib/postgresql/9.1/lib/pgxs/src/makefiles/pgxs.mk cannot be found. Please install the PostgreSQL server development packages and re-run configure.
The issue is that I do already have Postgres installed:
$ psql --version
psql (9.1.9)
I have checked this on two machines with the same configuration and get the same error. What am I missing here?
PostgreSQL is broken down into several packages, and having psql installed doesn't imply that the development packages are also installed.
According to the error message:
Please install the PostgreSQL server development packages and re-run
configure
you need:
# apt-get install postgresql-server-dev-9.1
Also note there's a APT pgdg repository providing recent pre-compiled versions of postgres-related packages (including postgis) that you may use instead of self-compiling.
If your system is set up to use this repository, just do:
# apt-get install postgresql-9.1-postgis-2.0
Daniel's answer works great except that it needs the following update:
$ sudo apt-get install postgresql-9.1-postgis-2.1
These packages can be updated some time in future again. So, it is recommended to search for new packages using aptitude and install the appropriate one:
$ aptitude search postgis

running qde(eclipse for blackberry developpement)

i've installed the Momentics IDE 2.0 for blackberry but something's wrong. i'm using debian x64, and when i try to run it, i get an error that says:
MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
/home/User/bbndk/configuration/org.eclipse.osgi/bundles/361/1/.cp/libswt-pi-gtk-4236.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
no swt-pi-gtk in java.library.path
/home/User/.swt/lib/linux/x86/libswt-pi-gtk-4236.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
Can't load library: /home/User/.swt/lib/linux/x86/libswt-pi-gtk.so
so on the blackberry page it says to install (ia32-libs) kind of librairies. i'm not able to install them because i get a message saying that:
some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ia32-libs : Depends: ia32-libs-i386 but it is not installable
E: Unable to correct problems, you have held broken packages.
how can i fix this?
I'm not sure how you got there coz in my case I was blocked from running java due to the ia32-libs.
In short, this is how I installed momentics-2.0 on my ubuntu 13.10 x86_64.
Add this line to the bottom of your /etc/apt/sources.list (Not sure if still need this yet):
deb http://ca.archive.ubuntu.com/ubuntu raring main universe
Installed these libs as a replacement of ia32-libs:
ywu#ywu-HP-8100:/install$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
Fix the missing libgtk-x11-2.0.so.0:
ywu#ywu-HP-8100:/install$ sudo apt-get install libgtk2.0-0:i386
Fix the missing libXtst.so.6:
ywu#ywu-HP-8100:/install$ sudo apt-get install libxtst6:i386
Install momentics-2.0:
ywu#ywu-HP-8100:/install$ sudo ./momentics-2.0-201310251201-linux.gtk.x86.bin
Good luck!