There are two approaches that I have tried to install visual studio code on my CentOS 7 system. Both have failed.
Approach 1 - Following official instructions (install via package manager)
The official instructions for installation visual studio code on CentOS is provided here. These instructions recommend installing via package manager rather downloading the RPM for the latest stable release.
In case the link for the instructions breaks in the future, I quote them here:
We currently ship the stable 64-bit VS Code in a yum repository, the following script will install the key and repository:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
Then update the package cache and install the package using dnf (Fedora 22 and above):
dnf check-update
sudo dnf install code
Or on older versions using yum:
yum check-update
sudo yum install code
I have followed these steps, and each command succeeds. However, when I run visual studio code with code
in my terminal, the visual studio code window is unresponsive.
Approach 2 - Install from standalone RPM downloaded from code.visualstudio.com
My second approach is to go to the code.visualstudio.com downloads page and download the standalone RPM for 64-bit Linux.
The website does not provide a checksum to verify the download, but I checked the file is a valid RPM:
$ file code-1.59.0-1628120127.el8.x86_64.rpm
code-1.59.0-1628120127.el8.x86_64.rpm: RPM v3.0 bin i386/x86_64 code-1.59.0-1628120127.el8
Next, I attempt to install with yum, which succeeds with an exit code of 0:
$ sudo yum install -y ./code-1.59.0-1628120127.el8.x86_64.rpm
<snipped>
Installed:
code.x86_64 0:1.59.0-1628120127.el8
Complete!
$ echo $?
0
Results
With both approach 1 and approach 2, when I run visual studio code after installation (I run code
from my terminal to launch the program), the visual studio code window is unresponsive.
What seems to be the problem
The system requirements page says glibcxx must be version 3.4.21 or later, and glibc must be version 2.15 or later.
My glibc is version 2.17, so the glibc requirement is met:
$ rpm -q glibc
glibc-2.17-324.el7_9.x86_64
When I check my /usr/lib64/libstdc++.so.6
I see that the highest gllibcxx available on my system is 3.4.19:
$ strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH
Assuming my old glibcxx version is the problem, how can I install glibcxx 3.4.21 or later on CentOS 7?
rpm -q glibc
shows my glibc is version 2.17. I triedrpm -q glibcxx
to check my glibcxx version, but it saidpackage glibcxx is not installed
. How can I check my glibcxx version?sudo find /usr/lib* -name 'libstdc++.so.*'
I see/usr/lib64/libstdc++.so.6
and/usr/lib64/libstdc++.so.6.0.19
.