树莓派ubuntu:vscode远程SSH开发调试

使用VSCODE可以SSH连接远程开发板,在开发板上调试开发程序

1. VSCODE安装插件"Remote - SSH"

2. 新建SSH连接配置

例如:ssh ubuntu@192.168.43.102

自动生成的配置文件内容如下:

bash 复制代码
Host 192.168.43.101
  HostName 192.168.43.101
  User ubuntu

添加新的连接后,可能需要重启VSCODE,否则看不到新增的SSH连接

3. 连接SSH

输入密码,点击回车

连接成功,可以像在本机一样编程开发了

4. 执行终端命令

VSCODE远程打开终端,执行编译运行等命令,调试开发更加方便

5. 安装git

将开发板上的源码同步上传到gitee或github,避免开发调试的代码只留在开发板上,造成源码丢失。

5.1 安装
bash 复制代码
sudo apt-get install git

如果出现如下错误,重启ubuntu再执行

bash 复制代码
ubuntu@ubuntu:~/pro/4WD-CAR-PY$ sudo apt-get install git
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 2711 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

参照gitee或github去初始化仓库以及上传

复制代码
mkdir test
cd test
git init 
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/zhb32412/test.git
git push -u origin "master"
相关推荐
稻谷君W2 小时前
Ubuntu 远程访问 Win11 WSL2 并固定访问教程
linux·运维·ubuntu
虚伪的空想家3 小时前
华为昇腾Atlas 800 A2物理服务器开启VT-d模式
运维·服务器·ubuntu·kvm·vt-d·直通
q***18845 小时前
Ubuntu上安装、使用Redis的详细教程
redis·ubuntu·bootstrap
人工智能训练6 小时前
windows系统中的docker,xinference直接运行在容器目录和持载在宿主机目录中的区别
linux·服务器·人工智能·windows·ubuntu·docker·容器
代码对我眨眼睛6 小时前
Ubuntu 系统 NVIDIA 显卡驱动自动化安装全流程
linux·ubuntu·自动化
xuyanqiangCode6 小时前
Ubuntu二进制安装Apache Doris(2.1版本)
linux·ubuntu·apache
(づど)7 小时前
解决VSCode中安装Go环境Gopls失败的问题
vscode·golang
Warren9817 小时前
Python自动化测试全栈面试
服务器·网络·数据库·mysql·ubuntu·面试·职场和发展
HIT_Weston17 小时前
39、【Ubuntu】【远程开发】拉出内网 Web 服务:构建静态网页(二)
linux·前端·ubuntu
QQRRRRW19 小时前
Tailwind+VScode (Vite + React + TypeScript) 原理与实践
vscode·react.js·typescript