linux环境搭建

1、**连接外网**

ssh在192.168.4.x上运行sudo ip link set ens160 down

ssh切换到192.168.3.x(外网ip),运行sudo ip route add default via 192.168.2.1 dev ens192 onlink //连接外网

使用完外网后

ssh在192.168.3.x上运行sudo ip link set ens160 up

ssh在192.168.4.x上运行sudo ip route del default via 192.168.2.1 dev ens192 onlink

sudo ip route add default via 192.168.4.1 dev ens160 onlink

2、**切换到home目录下,并更新apt包,sudo apt update 更新apt包**

3、**Ubuntu Linux安装工具链所需软件:**

sudo apt install -y python3 python3-dev python3-setuptools gcc libtinfo-dev zlib1g-dev build-essential libedit-dev libxml2-dev python3-pip

sudo apt install git

4、**Cmake安装**(在home目录下)

cmake --version(查看当前cmake版本)

sudo apt-get remove cmake (删除旧的cmake版本)

wget https://cmake.org/files/v3.17/cmake-3.17.1.tar.gz(下载cmake-3.17压缩包)

tar -xzvf cmake-3.17.1.tar.gz(解压cmake-3.17压缩包)

cd cmake-3.17.1

./bootstrap

make -j8

sudo make install

使用"cmake --version"验证是否安装成功。

5、**gtest安装**(在home目录下)

git clone [https://github.com/google/googletest.git\](https://github.com/google/googletest.git)

cd googletest

mkdir build

cd build

cmake ..

make --j4

sudo make install

6、**设置用户和密码**

sudo useradd -m -s /bin/bash yunquanlai

sudo passwd yunquanlai

  1. **安装更高版本gcc**

sudo apt-get update

sudo apt-get install gcc-14

sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/gcc 100

sudo update-alternatives --config gcc

相关推荐
Yana.nice13 小时前
/etc/rhsm/rhsm.conf配置文件解析
linux
Elecard 中国13 小时前
大规模媒体库如何实现自动化 QC?聊聊 VoD 文件检测架构
运维·自动化·ott·视频质检·vod·#视频编码·#音视频技术
Jurio.13 小时前
Codex cli 分屏并行运行
linux·ai·远程工作·codex
DolphinScheduler社区14 小时前
DolphinScheduler 3.1.3 跨越升级 3.4.1:基于 API 的自动化迁移方案
大数据·运维·自动化·任务调度·海豚调度
dangdanding14 小时前
防火墙 IP 分片测试套件-fragroute
linux·网络·网络协议·tcp/ip
happymade14 小时前
全网拓扑自动发现与服务器全维度监控的技术实践
linux·运维·服务器·网络·zabbix·路由器·prometheus
Ysn071914 小时前
中文乱码:在 Docker 容器中设置中文语言环境
运维·python·docker·容器
米高梅狮子14 小时前
01.CentOS-Stream-8-packstack安装OpenStack
linux·云原生·容器·kubernetes·centos·自动化·openstack
xiaoye-duck14 小时前
《Linux系统编程》Linux基础开发工具 (二):详解自动化构建 make / Makefile
linux
OpsEye14 小时前
数据库连接池爆了,这3个命令能救你一次
运维·数据库·后端