Dart throwing errors on linux: GLIBC_2.14 GLIBC_2.15 not found - linux

I'm running Debian 7.2 on Google Compute Engine (Though I suspect Centos, Red Hat, and Amazon Linux AMI all have the same problem). After downloading the 64-bit Linux version of the Dart SDK from this page, any dart command I run, for example, dart --version, will output the following error:
./editor/dart/dart-sdk/bin/dart: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.15' not found (required by ./editor/dart/dart-sdk/bin/dart)
./editor/dart/dart-sdk/bin/dart: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./editor/dart/dart-sdk/bin/dart)

Update: October 2014: Dart can now be installed on Debian with apt-get:
Instructions summarized from the dart website:
# Enable HTTPS for apt.
sudo apt-get update
sudo apt-get install apt-transport-https
# Get the Google Linux package signing key.
sudo sh -c 'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
# Set up the location of the stable repository.
sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
sudo apt-get update
# Finally, install the dart package!
sudo apt-get install dart
Instructions for building the binary yourself:
This problem appears to be caused by Google compiling against an edge version of GLIBC (>= 2.15) which is not generally supported on Linux outside of Ubuntu 12 (Precise Pangolin).
First of all, do not attempt to download an experimental version of GLIBC or EGLIBC. I was able to get dart to work using that method, but the rest of my machine fell apart. Updating GLIBC is a recipe for madness.
Instead, the best solution is building dart from source. Despite the GLIBC version requirements of the binary, the source itself has no such requirements. There are wiki pages for installing from source on debian, centos/fedora/red hat/amazon, ubuntu, and other linux versions.
Here is an overview of those steps, which I can confirm works on Debian 7.2. The centos/fedora/redhat steps appear to be the same except they use yum instead of apt-get.
Install subversion and the required build tools:
sudo apt-get -y update
sudo apt-get -y install subversion
sudo apt-get -y install make
sudo apt-get -y install g++
sudo apt-get -y install openjdk-6-jdk
Check out google's depot tools and add gclient to your path
svn co http://src.chromium.org/svn/trunk/tools/depot_tools
export PATH=$PATH:`pwd`/depot_tools
Download the dart source at the desired branch.
Replace 1.2 with whatever branch you wish to build. You can see a list of available versions here. In general, the latest numbered branch is best.
gclient config http://dart.googlecode.com/svn/branches/1.2/deps/all.deps
gclient sync
gclient runhooks
Move into the new dart directory
cd dart
Do only A or B below:
Note: For 32bit, use the --arch=ia32 flag instead.
A. Build the entire Dart SDK including pub, dart2js, dart, etc.:
tools/build.py --mode=release --arch=x64 create_sdk
B. Build just the dart executable:
tools/build.py --mode=release --arch=x64 runtime
The dart executable is now at either out/ReleaseX64/dart or out/ReleaseX64/dart-sdk/bin/dart you can do a smoke test by printing the version
dart/out/ReleaseX64/dart --version
The output should be something like Dart VM version: 1.2.0 (Mon Mar 3 03:06:20 2014) on "linux_x64".
How to help fix this issue
This was much more painful than it needed to be, since the binary clearly doesn't need to be built using GLIBC >= 2.15. If you wish to draw attention to this issue, please star this dart bug.

Related

On el8/el9/newer, how do you get newer versions of software like python3, gcc, java, etc?

For example on el7:
to develop an nvidia CUDA application you need a newer gcc than the default gcc version 4.8.x and to get the newer version you would use a software repo called "Software Collections" (SCL)
the base python3 is 3.6 and you need newer python modules and so you install python3.8 from SCL
Starting on el8, and el9: the SCL is deprecated and so there is a different method for installing and configuring newer versions of gcc and python3.
On el8/el9/newer, how do you get newer versions of software like python3, gcc, java, etc?
in a nutshell, here are some examples for how to install and configure
for python3 to get python3.9: dnf install -y python39 && alternatives --set python3 $(command -v python3.9)
for gcc to get gcc-12: dnf install gcc-toolset-12 && source scl_source enable gcc-toolset-12
for java to get java-17: dnf install java-17 && bin_java_filename=$(rpm -qa|grep java-17|xargs rpm -ql|grep "bin\/java$"|head -1) && alternatives --set java ${bin_java_filename}
tested on rocky8, rocky9
which repo has the newer software versions?
the old method using "SCL" was deprecated
the new method is to use a repo called "appstream"
here is a post written by the distro maintainers explaining the change https://developers.redhat.com/blog/2018/11/15/rhel8-introducing-appstreams
the repo is enabled by default
how to: install newer software versions?
for python3: dnf install python39
for gcc: dnf install gcc-toolset-12
how to: change the system default?
for python3: alternatives --set python3 $(command -v python3.9)
for gcc:
edit your user .bashrc or .bash_profile or create a new file under /etc/profile.d/ with the following: source scl_source enable gcc-toolset-12
i thought scl_source would go away in el8, el9 but apparently not
for more info on scl_source go to this link https://unix.stackexchange.com/a/195219/5510 or Permanently enable RHEL scl
p.s. what is the difference between alternatives and update-alternatives?
the original tool is called update-alternatives and is from Debian linux distro
in EnterpriseLinux, Redhat rewrote the tool and called it alternatives and when you install alternatives the package also installs a symlink with name update-alternatives on your env var PATH to help you find the tool
the two are similar but not the same because their source code is different

Is there a way to update visual-studio-code-bin which is installed from the arch wiki

visual-studio-code-bin is installed from the arch wiki. The only way I know how to actually update the software is reinstalling it again from the arch wiki which is tedious and inconvenient.
Any help is appreciated
Old post with a lot of split information so for anyone who finds this later, you have 2 choices:
Install the open source version of visual studio code from the official repos.
Install the official Microsoft binary version via the AUR that contains some proprietary code from Microsoft that is not available in the fully open version (e.g. some debugging some languages).
Info on how to do this can be found in the wiki.
It depends on how you installed vscode. If you did sudo pacman -S code, then the solution is to run it again. But if you did yay -S visual-studio-code-bin, then you should run THIS command again.
The best way to use VS Code on Arch is to use the open source version on the community repos. Which you can install by doing
sudo pacman -S code
visual-studio-code-bin is the proprietary binary which can be installed from the Arch User Repository.
If for some reason you want to go for the latter approach, you can either use an AUR helper or manage everything manually.
You can see the Arch Wiki's page on AUR helpers which shows the different options you have: https://wiki.archlinux.org/index.php/AUR_helpers
You can use these helpers to help manage your updates just like you would on pacman.
Here's how you would do things manually: https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_and_upgrading_packages
Just as a warning, AUR helpers are not supported by Arch Linux and the manual approach, though less user friendly is the recommended way by the Arch Wiki to manage your AUR Packages.
First a short version:
Simply run
sudo pacman -Sy
sudo pacman -S visual-studio-code-bin
The longer explanation:
Getting the right version of vscode
First of all, "code" and "visual-studio-code-bin" are two different packages. "code" is an open-source release and "visual-studio-code-bin" is an Microsoft-branded release. One of the major differences is that "code" doesn't support any Microsoft Extensions like C/C++, to my knowledge. This information can be found in the arch wiki: https://wiki.archlinux.org/title/Visual_Studio_Code#Installation. For more detailed information about the differences I'll refer you to the vscode repository: https://github.com/microsoft/vscode/wiki/Differences-between-the-repository-and-Visual-Studio-Code
By running "sudo pacman -S code" you (unintentionally) uninstall "visual-studio-code-bin" and install "code" because of wired some decency conflict.
So if you want to update/install "visual-studio-code-bin" run:
sudo pacman -S visual-studio-code-bin
This should fix any Problems with no functioning Microsoft-Extensions
Of course if you want to sick to the open-source version you can use
sudo pacman -S code
Fixing your Problem with not updating to the right version
I have to admit this took me ages. I had two machines, one with an freshly installed version of geruda Linux (an arch based distro) and an six moth old version of geruda Linux. Both had vscode installed. At the time of writing this the current version of vscode is 1.59.0-1. Interestingly the my old machine, witch had vscode version 1.58.0-1 installed didn't know that there was an newer version. The newer machine was aware of the the newer version. An simply running pacman -S visual-studio-code-bin didn't change anything. This hinted my to the problem of an not synchronized package database. And forcefully synchronizing the database with
sudo pacman -Sy
did the trick for me. For a more detialed information I would redirect you to the man pages: https://archlinux.org/pacman/pacman.8.html or this thread https://bbs.archlinux.org/viewtopic.php?id=117765. After running this command you only need to install vscode with "sudo pacman -S visual-studio-code-bin" or "sudo pacman -S code" to get the newest version of vscode
As rightly said by #AlexanderHD27 code is open source and vscode is microsoft official version but it is not open source. though code is more like an experimental version of of vscode; however, you can install code directly in archlinux using sudo pacman -S code but for the the vscode you have to clone the repository from github and install in the following way:
git clone visual-studio-code-bin
then cd visual-studio-code-bin and makepkg -si
remember if you don't have git installed you can do that using sudo pacman -S git. As for the update; code is updated during system full update but vscode is not updated. So, you have to cd into the directory again and do git pull the makepkg -si again.
As KamilCuk and Aviad mentioned there is no visual-studio-bin package, since it is a aur package you can use yay (AUR helper) to get a updateable version. For more information about yay see: https://github.com/Jguer/yay.
Install yay
sudo pacman -S --needed base-devel git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd ..
rm -rf yay
Install visual-studio-code-bin with yay
# install
yay -S visual-studio-code-bin
If you installed vscode via pamac manager in manjaro, try this:
pamac update
To update with the cloned AUR directory.
First update pacman database:
pacman-Sy
Then in the AUR directory you can update the AUR to the latest version with:
git pull
Then update dependencies with:
makepkg -s
Finally you install it:
makepkg -i
==> WARNING: A package has already been built, installing existing package...
==> Installing package visual-studio-code-bin with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...
Packages (1) visual-studio-code-bin-1.73.1-1
Total Installed Size: 324.26 MiB
Net Upgrade Size: 29.66 MiB
:: Proceed with installation? [Y/n]

Bitbucket pipeline installing the wrong version of cmake

When I apt-get install cmake in my Bitbucket pipeline, it installs version 3.0.2. This then leads to an error "CMake 3.7.2 or higher is required. You are running version 3.0.2". How can I install cmake version 3.7.2 or higher in my .yml?
bitbucket-pipelines.yml
image: gcc:6.5
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- apt-get update && apt-get -y install cmake
- cmake -B build .
Error:
+ cmake -B build .
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.7.2 or higher is required. You are running version 3.0.2
This isn't really a pipelines issue. I'll walk through the troubleshooting process to identify the problem and a possible solution. You could pursue other solutions to install your desired version but hopefully following the approach here will help you in future.
Full disclosure, I work for Atlassian - though not on the Bitbucket Pipelines team :)
The version of cmake that you see being installed is actually related to the third party base image you're using, gcc:6.5. You can test/verify this on your own machine:
$ docker run --rm -it gcc:6.5 bash
root#77d4fde67119:/# apt-get update && apt-get -y install cmake
root#77d4fde67119:/# cmake --version
cmake version 3.0.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
We can see the gcc:6.5 image is based on Debian Jessie:
root#77d4fde67119:/# cat /etc/os-release | grep PRETTY
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
If you look up the default cmake package for Jessie you'll find that it's v3.0.2: https://packages.debian.org/jessie/devel/cmake
A little more digging will show you that newer Debian versions package newer versions of cmake by default: Stretch or Buster will package 3.7 or 3.13 respectively. So the solution to your issue is using a newer version of the gcc base image based on a more recent Debian version:
Let's try it again with the gcc:7 base image:
$ docker run --rm -it gcc:7 bash
root#26e82f7b5e56:/# cat /etc/os-release | grep PRETTY
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
Well, that's a good sign: gcc:7 is based on Debian Buster. Buster ships 3.13: https://packages.debian.org/buster/devel/cmake
root#26e82f7b5e56:/# apt-get update && apt-get -y install cmake
root#26e82f7b5e56:/# cmake --version
cmake version 3.13.4
CMake suite maintained and supported by Kitware (kitware.com/cmake).
There you have it: a version above 3.7.
If you can't use this version of gcc, of course, you'll need to look at a different solution. But hopefully this helps to illustrate the source of your issue and how you can investigate these kinds of issues in future.

How do I install protobuf 2.5 on Arch Linux for compiling hadoop 2.6.0 using maven 3.3.1?

Am looking for installing protobuf 2.5.0 on Arch Linux, so that protoc-2.5.0.so is installed on the OS, so that I can go ahead with building hadoop 2.6.0 from source and make my life easy! :)
BTW, protobuf 2.6.0 does not compile when hadoop is built from source I have tried that as well. Ubuntu 14.04 comes with protoc 2.5.0. I DO NOT want to use Ubuntu.
Please check the screenshot first (there is no protobuf 2.5.0), since the problem lies there.. I guess
am getting the following exception, I am aware that protoc is not installed in arch linux currently.
[ERROR] Failed to execute goal
org.apache.hadoop:hadoop-maven-plugins:2.6.0:protoc (compile-protoc)
on project hadoop-common:
org.apache.maven.plugin.MojoExecutionException: 'protoc --version' did
not return a version -> [Help 1]
Please help me out, since, I have spent 4 hours every day from two days, with no luck.
Compiling Google's protobuf is pretty easy.
I originally found out how to do it on this blog post while compiling hadoop myself.
But here is my version:
$ cd /usr/local/src/
$ wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
$ tar xvf protobuf-2.5.0.tar.gz
$ cd protobuf-2.5.0
$ ./autogen.sh
$ ./configure --prefix=/usr
$ make
$ make install
$ protoc --version
Install protobuf for java
$ cd java
$ mvn install
$ mvn package
You should be good to go.
To enable you to install different versions of protobuf, install stow
then change ./configure --prefix=/usr to ./configure --prefix=/usr/local/stow/protobuf-2.5.0
Then link protobuf into your system with stow:
$ cd /usr/local/stow
$ stow protobuf-2.5.0
Note: stow uses /usr/local/bin by default. Make sure thats in your $PATH
To unlink that version of protobuf,
$ stow -D protobuf-2.5.0
Hope this helped.
I wonder why the above answer got downvoted,even I had to perform few more steps (in addition to the accepted answer by Rudker) to get protobuf 2.5 installed on Ubuntu Xenial.
Leaving the additional steps here for everyone's benefit:
apt-get install autoconf in response to the error : ./autogen.sh: autoreconf: not found for command : ./autogen.sh
apt-get install libtool in response to the error : autoreconf: libtoolize is needed because this package uses Libtool for command : ./autogen.sh
apt install g++ in response to the error : configure: error: C++ preprocessor "/lib/cpp" fails sanity check for command : ./configure --prefix=/usr
An easier but not future proof solution (for future queries) would be to head over to Arch Linux Archives: http://seblu.net/a/archive/packages/p/protobuf/
Uninstall the newer version of protobuf and install the downloaded package via pacman -U protobuf-2.5.x..
Though whenever you upgrade the Arch Linux packages via pacman you'd need to ensure you are doing: sudo pacman -Syu --ignore protobuf
I currently don't have enough reputation to comment, so I add a answer here to update the top voted answer.
Since protobuf move to different repo, the new wget command should be:
wget https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz
And in order to run ./autogen.sh, you may need install these:
sudo yum install libtool automake autoconf
For OSX prerequisites, try SunitaKoppar's answer (I don't know why the down-votes).
Thanks for the steps. Just wanted to add that, to get autogen.sh to work, I had to install the below packages (commands for mac below):
brew install gtk
brew install autoconf
brew install automake

QT version is not properly installed, please run make install

I installed QT-creator from a downloaded copy of qt-creator-linux-x86-opensource-2.6.1.bin using
sudo ./qt-creator-linux-x86-opensource-2.6.1.bin
in Ubuntu 11.04
I tried to add QT versions in QT-Creator/Build/QT-versions configuration and it asked for a qmake executable.
I installed it using:
sudo apt-get install qt4-devel
which deployed qmake in /usr/bin/qmake
I selected it in QT-Creator/Build/QT-versions configuration as manual, Qt-4.7.2 (System) /usr/bin/qmake-qt4 but QT version is not properly installed, please run make install message appears and I can't use it in QT-Creator/Build/Kits configuration.
How can I solve the problem and configure qmake for Qt-creator use in project creation?
This solved the problem for me on recent Ubuntu version:
sudo apt-get install qt5-default
Just so this no longer shows up as unanswered:
To install all qt-devel libraries, use
sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui
In Linux Mint 18.3 (32 bit) it also solved the problem:
sudo apt-get install qt5-default
So that Qt5 (5.5.1) was installed ready-to-use as a kit in QtCreator.
Although to install the Qt 5.9.0 version I had to explicitly download the package from https://download.qt.io/official_releases/qt/5.9/5.9.0/single/ (2 Gb unpacked) .
Then I had to run this command in terminal:
cd /home/username/Downloads/qt-everywhere-opensource-src-5.9.0
Then this command:
./configure
Then this
make
I was having this problem even after sudo apt-get install qt5-default (it was already installed).
However the version of QMake I had pointed to was in the Linux Processor SDK (02.00.02.11)
I fixed it by sourcing the environment setup before running qtcreator. The following shell script did it for me:
source /opt/ti/processor-sdk-linux-am335x-evm-02.00.02.11/linux-devkit/environment-setup
# substitute the location where the SDK is installed.
~/Qt5.9.0/Tools/QtCreator/bin/qtcreator -block
# substitute the location where QTCreator is installed

Resources