SBT install failure with aptitude on Ubuntu 14.04 - scala

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 /

Related

Issues with "`GLIBC_2.32' and `GLIBC_2.34' not found" when Installing Coursier as per Scala 'getting Started' Official Instructions

What I am trying to do:
I want to get started with Scala, as per https://docs.scala-lang.org/getting-started/index.html.
curl -fL https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz | gzip -d > cs && chmod +x cs && ./cs setup
The error I am getting:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 20.1M 100 20.1M 0 0 19.0M 0 0:00:01 0:00:01 --:--:-- 19.0M
./cs: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./cs)
./cs: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./cs)
OS, Java and LDD
Operating System (dual boot with Windows):
Ubuntu 20.04.5 LTS
Output of ldd --version:
ldd (Ubuntu GLIBC 2.31-0ubuntu9.9) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
JAVA (output of java --version)
openjdk 11.0.17 2022-10-18
OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu220.04)
OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu220.04, mixed mode, sharing)
Things I have tried:
sudo apt --fix-broken install
gives me
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 75 not upgraded.
sudo apt install -y libc6 libc-bin
gives me
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc-bin is already the newest version (2.31-0ubuntu9.9).
libc-bin set to manually installed.
libc6 is already the newest version (2.31-0ubuntu9.9).
0 upgraded, 0 newly installed, 0 to remove and 75 not upgraded.
Ultimately, I downloaded the deb from https://launchpad.net/ubuntu/groovy/amd64/libc6/2.32-0ubuntu2. When I run sudo dpkg -i libc6_2.32-0ubuntu2_amd64.deb I get:
dpkg: regarding libc6_2.32-0ubuntu2_amd64.deb containing libc6:amd64:
libc6:amd64 breaks locales (<< 2.32)
locales (version 2.31-0ubuntu9.9) is present and installed.
dpkg: error processing archive libc6_2.32-0ubuntu2_amd64.deb (--install):
installing libc6:amd64 would break locales, and
deconfiguration is not permitted (--auto-deconfigure might help)
Errors were encountered while processing:
libc6_2.32-0ubuntu2_amd64.deb
Otherwise, if I try to force it i.e.
sudo dpkg --force-all i libc6_2.32-0ubuntu2_amd64.deb, I get:
dpkg: error: need an action option
Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;
Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
You may try the static compiled version of the cs:
https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux-static.gz
At least in my setup this worked.
It's already an issue on their Github, which was closed 19 hours ago and will be fixed in the next release

dpkg: why does instdir need admindir parameter on Mint 21

We create a Debian package of our application using CPack which can be installed on Linux Mint 19 like this:
$ sudo dpkg -i --instdir=/opt myapp.deb
With Linux Mint 21 the (installed) dependencies are not resolved:
dpkg: dependency problems prevent configuration of myapp:
myapp depends on libsqlite3-0 however:
Package libsqlite3-0 is not installed.
...
After reading the dpkg man page I set the admindir parameter and the installation succeeds:
$ sudo dpkg -i --instdir=/opt --admindir=/var/lib/dpkg/ myapp.deb
If I do not set admindir to /var/lib/dpkg/ then the right environment is not found. Why is that? And why did it work without admindir on Mint 19? Using parameter root does not help because it expects the administrative directory to be a subdirectory of the instdir.
This is a bug, which seems I introduced in dpkg 1.21.0. I'll be preparing a fix and regression tests for dpkg 1.21.10 which should hit Debian unstable in few days I guess. For Mint, which seems to be based on Ubuntu, you'd need to request the Ubuntu people to consider including that fix once it's in Debian unstable, and then the Mint people to do the same. Otherwise you can specify both options as a workaround for now. :/
Please feel free to report this kind of problems upstream in the bug tracking system next time, I just happened to see this by accident today. :)

How to install VSCODE on debian 9? Nothing works

I'm trying to install Visual studio code.
My Raspb. Version is:
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.8 (stretch)
Release: 9.8
Codename: stretch
I tried several method (starting to download .deb and using dpkg or install command) but nothing worked.
How can I fix this problem? I really need VSC because my project is growing and Geany messes up.
Downloaded .deb and .tar files from the official site, followed the setup instruction but I got this error
With dpkg (both 32 and 64bit):
"package architecture (amd64) does not match system (armhf)"
"package architecture (i386) does not match system (armhf)"
With sudo install:
sudo apt install ./code_1.33.1-1554971066_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'code:amd64' instead of './code_1.33.1-1554971066_amd64.deb'
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:
code:amd64 : Depends: libnotify4:amd64 but it is not installable
Depends: libnss3:amd64 (>= 2:3.26) but it is not installable
Depends: apt:amd64 but it is not installable
Depends: libxkbfile1:amd64 but it is not installable
Depends: libsecret-1-0:amd64 but it is not installable
Depends: libgtk-3-0:amd64 (>= 3.10.0) but it is not installable
Depends: libxss1:amd64 but it is not installable
E: Unable to correct problems, you have held broken packages.
With repository:
pi#raspberrypi:~/Downloads $ sudo apt-get update
Err:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Temporary failure resolving 'raspbian.raspberrypi.org'
Err:2 http://archive.raspberrypi.org/debian stretch InRelease
Temporary failure resolving 'archive.raspberrypi.org'
Err:3 https://packages.microsoft.com/repos/vscode stable InRelease
Could not resolve host: packages.microsoft.com
Reading package lists... Done
W: Failed to fetch http://raspbian.raspberrypi.org/raspbian/dists/stretch/InRelease Temporary failure resolving 'raspbian.raspberrypi.org'
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/stretch/InRelease Temporary failure resolving 'archive.raspberrypi.org'
W: Failed to fetch https://packages.microsoft.com/repos/vscode/dists/stable/InRelease Could not resolve host: packages.microsoft.com
W: Some index files failed to download. They have been ignored, or old ones used instead.
pi#raspberrypi:~/Downloads $ sudo apt-get install code
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package code
I'm getting mad about this problem, I tried older repository but they don't work.
There are Community builds of Visual Studio Code available (for Raspberry Pi and other ARM and Intel systems).
The packages are currently available in DEB and RPM format. You can use the scripts provided here to install the packages and add their repository to your system or install it manually.
Below I summarized the steps:
Open a new terminal. If you need super-user rights (you probably do), then you can enter sudo -s and press return to enter a super-user session. Run the installer for your current distribution:
APT instructions
(including Debian, Raspbian, Ubuntu and Linux Mint)
. <( wget -O - https://code.headmelted.com/installers/apt.sh )
Press the return key. Once the installer has completed, you should have a "Code - OSS" entry in your desktop program list.
Manual installation
If for any reason the script above will not work on your system, or you do not want to add the package source for updates, you can get the latest version of the package for your system below.
Public GPG key
For either APT or YUM installation, you'll want the public GPG key to verify the package, which you can download here.
APT and YUM packages
The latest packages are available directly from the PackageCloud releases page.
The specific package you need is available here.
EDIT:
At this time (29.04.2019) the current release (v. 1.32) appears not to be working for everybody. See: issue#64. Seems that you'll have to go back to v. 1.29, which is reported to be running fine.
You can choose this package and install it manually, or use APT. If you decide to install it via APT, note that you'll have to mark the package on hold as described below.
To prevent code-oss from upgrading (so that you can keep v. 1.29 until the issue is fixed) follow these instructions:
Install v. 1.29 via APT:
apt-get install code-oss=1.29.0-1539702286
Then mark it on hold by running:
apt-mark hold code-oss
Now running apt-get upgrade won't try to bump it up until you run:
apt-mark unhold code-oss
This will allow it to upgrade again as usual.

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

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.

Which missing library results in the message '/usr/bin/ld: cannot find -lglib-2.0'?

I am cross compiling a Lazarus program, creating a 32bit program on a 64bit Ubuntu 14.04 Trusty Tahr system, and everything apparently compiles to the very end when I get this messsage
/usr/bin/ld: cannot find -lglib-2.0
What is the full name of the library whose absence results in this error mesage?
libc6-dev:i386 appears to be the most likely library, but when I try to install it with apt indicates build-essential g++ gcc gcc-multilib will be removed so I abort it.
sudo apt-get install libc6-dev:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
linux-libc-dev linux-libc-dev:i386
Suggested packages:
glibc-doc:i386 manpages-dev:i386
Recommended packages:
gcc:i386 c-compiler:i386
The following packages will be REMOVED
build-essential g++ gcc gcc-multilib
The following NEW packages will be installed
libc6-dev:i386 linux-libc-dev:i386
The following packages will be upgraded:
linux-libc-dev
1 to upgrade, 2 to newly install, 4 to remove and 18 not to upgrade.
Need to get 3,126 kB of archives.
After this operation, 12.6 MB of additional disk space will be used.
Do you want to continue? [Y/n]
It turns out it was the libglib2.0-0:i386 package. It was already installed earlier, but it had not been fully configured.
It was present in the /lib/i386-linux directory and I had to create a symlink to it include it to the fpc.cfg configuration file used by Free Pascal.
locate libglib | grep ^/lib produced:
/lib/i386-linux-gnu/libglib-2.0.so.0
/lib/i386-linux-gnu/libglib-2.0.so.0.4002.0
/lib/x86_64-linux-gnu/libglib-2.0.so.0
/lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0
I symlinked it with the expected name:
ln -s /lib/i386-linux-gnu/libglib-2.0.so.0 /lib/i386-linux-gnu/libglib-2.0.so
then added to the Lazarus installations fpc.cfg file
#ifdef cpui386
-Fl/usr/lib32
-Fl/lib/i386-linux-gnu
#endif