安装 Raspberry Pi 操作系统

2018-11-24  本文已影响23人  斐然成章

树莓派有多种操作系统可供选择,其中 Raspbian 是当前使用最广泛的树莓派操作系统,此文简单记录安装步骤,详细的安装步骤请阅读官方文档 Installation Guides

  1. https://www.raspberrypi.org/downloads 官网下载 raspbian lite 镜像。
    执行 unzip 解压 .zip 镜像
$ unzip 2018-11-13-raspbian-stretch-lite.zip 
Archive:  2018-11-13-raspbian-stretch-lite.zip
  inflating: 2018-11-13-raspbian-stretch-lite.img  
  1. 把 SD Card 插到电脑上,执行 lsblk 能看到多出一个 sdX 设备,比如 sdb 。
$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb      8:16   1  14.5G  0 disk
  1. 执行 dd 命令将 raspbian lite 镜像写入 SD Card 中。
$  sudo dd bs=4M if=2018-11-13-raspbian-stretch-lite.img of=/dev/sdb status=progress conv=fsync
445+0 records in
445+0 records out
1866465280 bytes (1.9 GB, 1.7 GiB) copied, 376.851 s, 5.0 MB/s
  1. 检查镜像是否正确写入 SD Card (可选操作)
$ sudo dd bs=4M if=/dev/sdb of=from-sd-card.img count=445
445+0 records in
445+0 records out
1866465280 bytes (1.9 GB, 1.7 GiB) copied, 87.086 s, 21.4 MB/s
$ sudo truncate --reference 2018-11-13-raspbian-stretch-lite.img from-sd-card.img
$ diff -s 2018-11-13-raspbian-stretch-lite.img from-sd-card.img 
Files 2018-11-13-raspbian-stretch-lite.img and from-sd-card.img are identical
  1. 最后执行 sync 刷新写缓存,确保卸载 SD card 是安全的。
上一篇 下一篇

猜你喜欢

热点阅读