树莓派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"
相关推荐
zhangrelay20 小时前
ROS 2 Lyrical 第4章 URDF机器人建模与Gazebo Garden仿真
linux·笔记·学习·ubuntu·机器人·ros2
mgaofeid1 天前
Ubuntu 24.04 中文输入法安装
linux·运维·ubuntu
bosins1 天前
Ubuntu 24.04部署llama.cpp下载资源一直中断的解决方案
ubuntu·eureka·llama
sxstj2 天前
Ubuntu 完整安装并启用 Flatpak 教程
linux·运维·ubuntu
天疆说2 天前
Ubuntu 26.04 下 Intel Meteor Lake 核显 + NPU 驱动配置与 PyTorch NPU 推理实测
linux·pytorch·ubuntu
持敬chijing2 天前
PHP开发-环境搭建-安装phpstudy-vscode工具
开发语言·vscode·php
meilindehuzi_a2 天前
TypeScript面试题:interface 与 type:相同点、核心区别与选择指南
java·ubuntu·typescript
csdn_aspnet2 天前
Copilot能换成本地吗?VSCode接本地大模型本地化接入方案
ide·vscode·ai·ollama
铁锚2 天前
解决Ubuntu执行sudo时 unable to resolve host 报错问题
linux·数据库·ubuntu
Delta-delta2 天前
win+ubuntu24.04双系统安装
ubuntu