因为又在知乎看到了Remote Development这个好像很厉害的VS Code插件(好吧,其实是一整套的插件),看起来很厉害,双11期间氪了个88的腾讯云,虽然估且配置好了连接,然而好像没啥实用性,又没打算备案。。
所以这几天又打算在自己实际建站的空间上折腾(感觉会很作死),然后再一次发现我还在用落后于时代的CentOS6,笔记本也是,内存小不小不说,SSD都没有。。。
比起重装到7,先尝试找了下有没有解决方法,然后好像确实找到了,现在一边操作一边写这篇总结。
「AD:香港vps限时九者」
Linux Prerequisites for Visual Studio Code Remote Development
根据官方文档,CentOS 6不支持远程开发,但是有解决方案(Unsupported, but has workaround)。
执行时这里遇到了如下提示:
libstdc++ = 4.4.7-23.el6 is needed by (installed) gcc-c++-4.4.7-23.el6.x86_64
相当于要升级的话需要卸载掉旧版本,但是旧版又被另一个库所依赖,如果你也遇到了,可以先使用yum remove gcc-c++
移除掉,然后重新执行:
sudo rpm -Uh \
libstdc++-4.8.2-16.3.el6.x86_64.rpm \
libstdc++-devel-4.8.2-16.3.el6.x86_64.rpm \
libstdc++-static-4.8.2-16.3.el6.x86_64.rpm
注:升级后卸掉的东西就装不回来了,不知道会有什么影响;
↓↓你可以直接尝试以下命令,如果报错在按上边的处理。
# 以下内容直接复制自VSCode网站
# Linux Prerequisites for Visual Studio Code Remote Development
# https://code.visualstudio.com/docs/remote/linux#_updating-glibc-and-libstdc-on-rhel-centos-6
# Update glibc and static libs
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
wget https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-utils-2.17-55.el6.x86_64.rpm
wget https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-static-2.17-55.el6.x86_64.rpm
sudo rpm -Uh --force --nodeps \
glibc-2.17-55.el6.x86_64.rpm \
glibc-common-2.17-55.el6.x86_64.rpm \
glibc-devel-2.17-55.el6.x86_64.rpm \
glibc-headers-2.17-55.el6.x86_64.rpm \
glibc-static-2.17-55.el6.x86_64.rpm \
glibc-utils-2.17-55.el6.x86_64.rpm
# Update libstdc++
wget https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/gcc-4.8.2-16.3.fc20/libstdc++-4.8.2-16.3.el6.x86_64.rpm
wget https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/gcc-4.8.2-16.3.fc20/libstdc++-devel-4.8.2-16.3.el6.x86_64.rpm
wget https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/gcc-4.8.2-16.3.fc20/libstdc++-static-4.8.2-16.3.el6.x86_64.rpm
sudo rpm -Uh \
libstdc++-4.8.2-16.3.el6.x86_64.rpm \
libstdc++-devel-4.8.2-16.3.el6.x86_64.rpm \
libstdc++-static-4.8.2-16.3.el6.x86_64.rpm