# 树莓派更新从 Raspbian Jessie 到Raspbian Stretch

查看系统版本

Ubuntu系的系统和Centos这种不一样,先要做update,这个只是更新了软件列表,然后使用upgrade才能更新。所以两步都要做的,更新之后内核版本之类的都会发生变化,用下面两个命令查看:

uname -a 和
sudo lsb_release -a

更新前:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

pi@raspberrypi:~ $ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 8.0 (jessie)
Release:        8.0
Codename:       jessie

更新后:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l GNU/Linux

pi@raspberrypi:~ $ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.4 (stretch)
Release:        9.4
Codename:       stretch

更新步骤

  1. Fully Upgrade Current System

    Start by fully upgrade your current Raspbian system before you proceed with a Stretch upgrade.

    $apt-get update
    $apt-get upgrade
    

    Upgrade any held back packages:

    $apt-get dist-upgrade
    
  2. System Check

    Last, chance to check for any system inconsistencies. Perform database sanity and consistency checks for partially installed, missing and obsolete packages:

    $dpkg -C
    

    If no issues are reported, check what packages are held back:

    $apt-mark showhold
    
  3. 更新软件源Update Package Repository to Debian Stretch

    这里使用清华大学的开源镜像站作为软件源
    换源教程

    $sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list
    $sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list.d/raspi.list
    
  4. update更新本地软件列表
    $sudo apt update
    
  5. 测试升级,这一步只是演练一下,如果有问题就得回退
    $sudo apt --simulate upgrade
    
  6. 正式升级到新的代号
    $sudo apt upgrade
    $sudo apt dist-upgrade
    
  7. All done. Reboot your system.

Congratulations

One Reply to “树莓派更新从 Raspbian Jessie 到 Raspbian Stretch”

发表评论

电子邮件地址不会被公开。 必填项已用*标注