树莓派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"
相关推荐
袁袁袁袁满10 分钟前
Ubuntu怎么查看系统日志?
linux·运维·服务器·ubuntu
加成BUFF22 分钟前
基于DeepSeek+Python开发软件并打包为exe(VSCode+Anaconda Prompt实操)
vscode·python·prompt·conda·anaconda
yuyuyuliang002 小时前
Ubuntu 22.04安装PostgreSQL教程
linux·运维·ubuntu·postgresql
SiYuanFeng2 小时前
vscode中markdown使用单个$显示公式($...$),preview页面里公式显示失败
ide·vscode·编辑器
御坂10101号3 小时前
Total Recall:让 Claude 学会忘记,优化记忆管理
经验分享·vscode·开源·软件工程·ai编程
njtong3 小时前
Ubuntu系统apache2网站的Let‘s Encrypt证书问题
linux·运维·ubuntu
HIT_Weston4 小时前
132、【Ubuntu】【Hugo】搜索功能异常(问题解决)(二)
linux·运维·ubuntu
xj198603195 小时前
Java进阶-在Ubuntu上部署SpringBoot应用
java·spring boot·ubuntu
嵌入小生0075 小时前
线程 --- 嵌入式(Linux)
linux·vscode·vim·嵌入式·线程·进程
coderYYY17 小时前
VSCode终端启动报错
前端·ide·vscode·npm·编辑器