Ubuntu-22.04环境搭建

安装wget(一般ubuntu会自带)

cpp 复制代码
sudo apt-get install wget

更换国内软件源

先备份原来的/etc/apt/source.list⽂件

cpp 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

防止修改错误 导致无可挽回

将下列国内镜像源 写入原来的/etc/apt/source.list⽂件(注意格式 防止格式出错)

cpp 复制代码
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
#添加清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

新增完毕后,更新源

cpp 复制代码
sudo apt-get update

安装lrzsz传输⼯具

cpp 复制代码
sudo apt-get install lrzsz

rz --version

安装编译器gcc/g++

cpp 复制代码
sudo apt-get install gcc g++

安装项⽬构建⼯具make

cpp 复制代码
sudo apt-get install make

安装调试器gdb

cpp 复制代码
sudo apt-get install gdb

安装git

cpp 复制代码
sudo apt-get install git

git --version

安装cmake

cpp 复制代码
sudo apt-get install cmake

cmake --version

安装jsoncpp

cpp 复制代码
sudo apt-get install libjsoncpp-dev

安装Muduo

cpp 复制代码
git clone https://github.com/chenshuo/muduo.git

Muduo库克隆的时候可能会有点慢

但是我替换了软件源 感觉挺快的

安装依赖环境

cpp 复制代码
sudo apt-get install libz-dev libboost-all-dev

我在安装依赖环境的时候出现 依赖包的依赖关系问题

我参考了以下文章

没有安装依赖包 如何去安装

不能安装的依赖包如何去解决

当然,你遇到的问题也许不是我所遇到的。

运⾏脚本编译安装

cpp 复制代码
unzip muduo-master.zip
./build.sh
./build.sh install

没有安装unzip需要去安装

cpp 复制代码
sudo apt-get install unzip
相关推荐
HIT_Weston15 分钟前
18、【Ubuntu】【远程开发】技术方案分析:私网ip掩码
linux·tcp/ip·ubuntu
cccccc语言我来了19 分钟前
(Linux (6):从包管理到工具探索,构建系统操作基础认知)
linux·运维·服务器
ben9518chen1 小时前
嵌入式Linux C语言程序设计九
linux·c语言
wuk9981 小时前
CentOS7环境搭建L2TP服务器
运维·服务器
恒创科技HK1 小时前
香港1核2G云服务器当网站服务器够用不?
运维·服务器
颜大哦2 小时前
linux安装mysql
linux·运维·mysql·adb
学习3人组2 小时前
Node.js 网站服务器开发
运维·服务器·node.js
来知晓2 小时前
Linux:WSL内存空间管理之清完内存C盘可用空间不增问题解决
linux·运维·服务器
大聪明-PLUS3 小时前
嵌入式 Linux 初学者指南 – 第 2 部分
linux·嵌入式·arm·smarc
GTgiantech3 小时前
科普SFP 封装光模块教程
服务器·网络·数据库