c++ :虚拟机centos7+vscode

c++ :虚拟机centos7+vscode

gcc、g++、make

查看是否安装成功

$ gcc --version
$ g++ --version
$ make --version

哪个没有,就yum install gcc-c++/yum install gcc/yum install make

yum报错

"Failed to connect to 2001:da8:8000:6023::230: 网络不可达":参考链接

先关掉防火墙试试:

$ systemctl stop firewalld.service //停止firewall
$ systemctl disable firewalld.service // 禁止firewall开机启动

此时再安装仍然报错,则查看网络ifconfig,网卡ens33中IPv6服务正常

$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.137.130  netmask 255.255.255.0  broadcast 192.168.137.255
        inet6 fe80::74c2:7e68:5906:8f9a  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:e8:40:82  txqueuelen 1000  (Ethernet)
        RX packets 17612  bytes 19517721 (18.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6798  bytes 613289 (598.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

设置临时关闭服务:

$ echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
$ echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6

再次使用yum安装则成功

vscode

官网下感觉速度也还好,当然想从别的地方下载也没有任何问题,我是下的1.53版本的

image-20220828125816956

我从本机上下载该rpm包后copy到虚拟机安装时会报错,查询说移动过程中数据损失,所以直接用虚拟机去这个网页下的

下载完后,先安装依赖

$ yum install libXScrnSaver -y

加载包(包名要自己的!)

$ rpm -ivh code-1.53.2-1613044734.el7.x86_64.rpm

现在重启就能在系统设置里找到

image-20220828130405152

posted @ 2022-08-28 14:04  比萨在哭  阅读(41)  评论(0编辑  收藏  举报