参考网址: 树莓派raspberry 安装ubuntu18.04 server + desktop + ros1_越来越胖了_mengleijin的博客-CSDN博客
树莓派4b安装带桌面的ubuntu18.04 server和ROS melodic系统 - 灰信网(软件开发博客聚合) (freesion.com)
树莓派4B安装Ubuntu18.04 + vnc远程桌面_我是大一菜鸡-CSDN博客
img镜像下载 pi烧录软件:https://downloads.raspberrypi.org/imager/imager_latest.exe
树莓派操作系统镜像下载地址
ubuntu18_server
https://mirrors.tuna.tsinghua.edu.cn/ubuntu-cdimage/ubuntu/releases/18.04.5/release/
将系统烧入SD卡 使用win32diskimager 或者balenaetcher 烧录进去
启动树莓派 将SD卡插入树莓派,并为树莓派连接好电源,显示器,鼠标,键盘,网线。启动树莓派,默认用户名密码都是ubuntu
,之后需要马上修改密码,按提示操作即可。
SSH 打开 system-boot
磁盘下根目录的 network-config
文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 # This file contains a netplan-compatible configuration which cloud-init # will apply on first-boot. Please refer to the cloud-init documentation and # the netplan reference for full details: # # https://netplan.io/reference # version: 2 ethernets: eth0: dhcp4: false addresses: [192.168.30.110/24] wifis: wlan0: access-points: HUAWEI_PTY: password: pty123456787 dhcp4: true
修改在相同目录下的 user-data
文件,expire:
后改成false
。
启动树莓派 如果是刷完固件后第一次启动,因为第一次需要进行系统配置,所以第一次不会自动连接。第一次上电过两分钟后重新上电稍等片刻就会自动连接wifi了。
连网 可以参考:
Ubuntu Server 18.04 连接 WIFI_zyr920425的博客-CSDN博客
编辑,注意需要使用Tab
键对齐,建议使用能看到对其线的对其工具,比如sublime
1 sudo nano /etc/netplan/xxxxxxx.yaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init's # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: {config: disabled} network: version: 2 ethernets: eth0: dhcp4: false addresses: [192.168.8.110/24] wifis: wlan0: access-points: HUAWEI_PTY: password: pty123456787 dhcp4: true optional: true
换源 1 sudo nano /etc/apt/sources.list
参考:树莓派4安装 18.04ubuntu server(2020.11.2)_lovely_yoshino的博客-CSDN博客_树莓派ubuntu18.04
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 deb http://mirrors.aliyun.com/ubuntu-ports bionic main restricted deb http://mirrors.aliyun.com/ubuntu-ports bionic-updates main restricted deb http://mirrors.aliyun.com/ubuntu-ports bionic universe deb http://mirrors.aliyun.com/ubuntu-ports bionic-updates universe deb http://mirrors.aliyun.com/ubuntu-ports bionic multiverse deb http://mirrors.aliyun.com/ubuntu-ports bionic-updates multiverse deb http://mirrors.aliyun.com/ubuntu-ports bionic-backports main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu-ports bionic-security main restricted deb http://mirrors.aliyun.com/ubuntu-ports bionic-security universe deb http://mirrors.aliyun.com/ubuntu-ports bionic-security multiverse deb-src http://mirrors.aliyun.com/ubuntu-ports bionic main restricted deb-src http://mirrors.aliyun.com/ubuntu-ports bionic-updates main restricted deb-src http://mirrors.aliyun.com/ubuntu-ports bionic universe deb-src http://mirrors.aliyun.com/ubuntu-ports bionic-updates universe deb-src http://mirrors.aliyun.com/ubuntu-ports bionic multiverse deb-src http://mirrors.aliyun.com/ubuntu-ports bionic-updates multiverse deb-src http://mirrors.aliyun.com/ubuntu-ports bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu-ports bionic-security main restricted deb-src http://mirrors.aliyun.com/ubuntu-ports bionic-security universe deb-src http://mirrors.aliyun.com/ubuntu-ports bionic-security multiverse
SSH连接 网线连接好,通过ip a
查看是否配置好,然后在物理机上尝试ping
通后连接
1 ssh.exe ubuntu@192.168.xx.xx
安装gcc与g++ 1 sudo apt-get install build-essential