树莓派系统升级 Wheezy 到 Raspbian Jessie

Upgrade-debian-7-to-8-0
树莓派官方在上周放出了 Raspbian 8 Jessie 镜像文件下载。这是 Raspbian Wheezy 2015.5.5 之后的一次更新版本,核心版本升级到了 4.1。而老的 Wheezy 版本也可以通过简单的步骤升级到 Raspbian Jessie 8 且不用重新刷写镜像。下面将介绍如何升级,要知道,升级有可能会破坏现有系统,在此之前请一定注意备份好老的系统(你可以用镜像读写工具备份现有系统)。如果你对之前的系统做的更改越小,升级将会越顺利。
1. 建议:

移除非必要的包
完整升级当前系统
备份数据
虽然用SSH操作问题不大,但还是建议直进入终端来操作

  1. 升级当前系统
    在当前的 Wheezy 下运行:

apt-get update
apt-get upgrade
apt-get dist-upgrade

  1. 更新 apt sources list
    sed -i 's/wheezy/jessie/g' /etc/apt/sources.list
    注释掉 archive repository. 最终变更为如下:
    deb http://mirrordirector.raspbian.org/raspbian jessie main firmware contrib non-free
    #deb http://archive.raspberrypi.org/debian jessie main
    4. 更新到 Raspbian Jessie
    一旦进入升级,会需要选择手动重启当前运行的所有服务。建议选择手动重启服务(如SSH服务),这也将保证当你用SSH操作时连接不会被中断。建议检查并确保 SSH 没有禁用 root 登录。
    一切就绪之后初始化系统并升级到 Raspbian Jessie:

apt-get update
apt-get upgrade
apt-get dist-upgrade

重启系统:
reboot
升级成功后,用 hostnamectl 可以看到当前 Raspbian 系统版本是 Raspbian GNU/Linux 8 (jessie):

hostnamectl
Static hostname: pi
Icon name: computer
Chassis: n/a
Machine ID: e8b0569e6af846b7b3c9911191e2da9a
Boot ID: 273f90ee3a014119a948afa3a3aa95f3
Operating System: Raspbian GNU/Linux 8 (jessie)
Kernel: Linux 3.18.0-trunk-rpi
Architecture: arm

标签: 树莓派教程