树莓派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"
相关推荐
鸡啄米的时光机7 小时前
vscode的一些实用操作
vscode·学习
魔希达8 小时前
windows在wsl ubuntu环境中启用cuda加速AI推理和训练
人工智能·windows·ubuntu
灰色人生qwer11 小时前
React + TypeScript+ Vite 配置路径别名和vscode智能路径提示
vscode·react.js·typescript
莲动渔舟11 小时前
赶AI大潮:在VSCode中使用DeepSeek及近百种模型的极简方法
ide·人工智能·vscode·deepseek
咩咩大主教12 小时前
VSCode运行Go程序报错:Unable to process `evaluate`: debuggee is running
开发语言·ide·vscode·golang·编辑器
佛曰我不想说话12 小时前
通过VSCode直接连接使用 GPT的编程助手
ide·vscode·copilot
lsw1990lsw14 小时前
ubuntu在线安装PostgreSQL(pgsql)
linux·ubuntu·postgresql
盗理者14 小时前
管理WSL实例 以及安装 Ubuntu 作为 WSL 子系统 流程
linux·运维·ubuntu
Eric.Lee202114 小时前
Ubuntu 系统 cuda12.2 安装 MMDetection3D
深度学习·ubuntu·mmdetection3d·点云检测·三维点云检测
羊村懒哥15 小时前
VScode内接入deepseek包过程(本地部署版包会)
人工智能·vscode·deepseek