Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions docs/tutorials/upgrading-ev3dev-from-command-line.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: Upgrading Ev3dev from the Command Line
subject: System
---

{% include icon.html type="warning" %}
By upgrading ev3dev you are also upgrading the drivers, so there may be changes that break user software.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not necessarily upgrading drivers and drivers are not the only thing that can break other software.

Furthermore, my advice is the Linux Mint philosophy: if everything is working and you are happy, then don't upgrade. Only upgrade if A) something is not working for you and you think that upgrading a package will fix the problem or B) you want to help with testing ev3dev and you plan on reporting bugs when you find something that is broken.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you expect me to change based on that information. If people get to this page, they have either found it by themselves or been told to come here. In the former case, they probably know what they are doing anyways (and that case will be rare); in the latter, the context from which they came dictates what they are here for, and it's almost certainly to upgrade ev3dev -- that's what the title says, after all.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saying "upgrading ev3dev" is ambiguous. What is "ev3dev" exactly? If you want to make a statement about upgrading drivers, then saying "upgrading the kernel package" would make more sense because upgrading the kernel is specifically what upgrades the drivers.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saying "upgrading the kernel package" would make more sense because upgrading the kernel is specifically what upgrades the drivers.

More technically correct? Yes. More sense to us? Yes. More sense to the average "beginner" user? No. I'm shooting low, and then if someone knows more they can apply it here as well. To most people, they would view "ev3dev" as the whole installation, and associate "ev3dev version" with the generic software version, similar to a version of iOS or WIndows (or even Linux, although they wouldn't have experience with that). It's only people who actually understand what these packages are and how they interact that would make the distinction of "ev3dev version" and "ev3dev kernel version"..

In the end, if someone knows what a "kernel package" is, they probably won't need this page to help them out.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To most people, they would view "ev3dev" as the whole installation, and associate "ev3dev version" with the generic software version, similar to a version of iOS or WIndows

I get what you are saying here. But I will argue that this would be analogous to upgrading ev3dev-jessie to ev3dev-stretch. Packages are just "apps" in the iOS or Windows sense. Upgrading the kernel package is like installing Windows updates, not like upgrading Windows itself.

@WasabiFan WasabiFan Sep 9, 2016 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose the Win32 API hasn't had any breaking changes since Windows 3.1, so it's more of a difficult comparison than I originally imagined 😆 We really just need to pick a way to tell users to imagine it and stick with it everywhere.

You should check the ev3dev [news feed](http://www.ev3dev.org/news/){: .alert-link } for breaking changes before upgrading.
{: .alert .alert-warning}

When you flash an SD card with an ev3dev image, you are "installing" the version of ev3dev that was available at the time that the image was made. However, sometimes you will want to upgrade the version of ev3dev that you are using so that you can take advantage of new features that have been added or bug fixes that have been made. One option to get a new version is to re-flash your SD card with a newer image, but this also deletes any files you have saved on it. Alternatively, you can upgrade the ev3dev system (the device drivers and kernel) without having to delete any of your work. In this tutorial, we will show you how to upgrade ev3dev from the command line.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sometimes you will want to upgrade the version of ev3dev

We aren't upgrading "versions" we are upgrading "packages"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To a beginner, upgrading "packages" is meaningless. The point of this paragraph is to explain what this notion of "packages" is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of this paragraph is to explain what this notion of "packages" is.

How do you do that without ever mentioning the work "package"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understanding the concept is different from knowing the name; it didn't seem important so I omitted it until it becomes useful. I can add that name if you want, but even then it'd take some creative wording to call it the "ev3dev kernel package" and still have it make sense to a beginner. I might be able to make that work though.


**Make sure that you have already configured a network connection and connected to ev3dev via SSH before beginning.**


Before starting the upgrade process, you will need to have ev3dev download a list of the most recent versions of available software. To do this, run the following command:


sudo apt-get update

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if we just listed this with the upgrade commands. If it is separate, people will miss it and wonder why upgrade is failing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the feedback items that you had on the original implementation of this PR was that you wanted an explanation of what this command does. I can copy the command into both of the other sections, but where would I then put the explanation?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to explain all three command (update, upgrade, dist-upgrade) at the end of the "Upgrading all packages" section.

update: fetches the list of packages from the package repository servers
upgrade: upgrades all packages that do not require installing new packages or removing existing packages
dist-upgrade: upgrades packages that require installing new dependencies or removing conflicting packages

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that the "update" description, as well as the command, is applicable to both sections. I could only include the description in one of the two sections, but then the other would be lacking it.



This might take up to ten minutes, depending on hardware and network connection speed.

------

You have multiple options in how you upgrade ev3dev. You can either upgrade just the ev3dev core (which is the quickest option) or upgrade all software installed on the EV3 (which may take an hour or longer).

@dlech dlech Sep 9, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the "ev3dev core"? the kernel?

What about upgrading other packages one at a time?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the "ev3dev core"? the kernel?

The kernel and any packages it depends on.

What about upgrading other packages one at a time?

That's out of the scope of this tutorial as it stands, and honestly I don't think it should be modified to include that. The individual docs for those packages or forum questions found online will tell the user to upgrade them at various points, but a user won't come to our site asking how to upgrade bash, for example.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about brickman or flash-kernel or python3-ev3dev or any of the other 30+ ev3dev-specific packages?


# Upgrading just the ev3dev kernel (faster)

Run the following command, replacing `linux-image-ev3dev-ev3` as shown below:

sudo apt-get install linux-image-ev3dev-ev3


Hardware platform | Package name
-----------------------------------|-------------
LEGO MINDSTORMS EV3 | `linux-image-ev3dev-ev3`
Raspberry Pi Zero / Raspberry Pi 1 | `linux-image-ev3dev-rpi`
Raspberry Pi 2 / Raspberry Pi 3 | `linux-image-ev3dev-rpi2`
BeagleBone | `linux-image-ev3dev-bb.org`
{: .table .table-striped .table-bordered }


If that command prints `linux-image-ev3dev-ev3 is already the newest version.`
there was no new kernel available, and you are done (unless you forgot to run
`sudo apt-get update` as shown above). If the command does not output that line,
**you will need to reboot the EV3 before the new kernel can be used. Do so through
Brickman on the EV3 display or by running `sudo reboot`.**

# Upgrading all packages (slower)

Run these commands in the following order:

sudo apt-get upgrade

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to have sudo apt-get update here too.

sudo apt-get dist-upgrade

Wait for each command to complete before typing the next. Some steps require
confirmation to proceed. Press 'y' when asked.

{% include icon.html type="warning" %}
The `upgrade` step may take a couple hours to complete, depending on your network
connection and hardware.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and most importantly, how many packages actually need to be upgraded.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point; will-do.

{: .alert .alert-warning}

Although you don't necessarily need to reboot if no new kernel was installed,
it's difficult to see whether one was installed based on the command output.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a linux-image-* package listed, then the kernel was upgraded. It's not that hard to see. Also flash-kernel will run which is also easy to see.

Well, easy for me anyway. 😉

To reboot, run `sudo reboot` or do it through Brickman.

# Confirming that the upgrade worked

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only confirms that a kernel upgrade have worked. It should be listed immediately after the kernel upgrade section.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of the sections have the goal of upgrading the kernel, it's just a matter of how it is done: target just the necessary packages vs. get upgrades for everything else as well. I think this separate section is important to have so that a) you have obvious instructions for checking regardless of the method (both may have upgraded the kernel) and b) we can link to it directly when telling people to check their kernel version after upgrading.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way I see it, one is upgrading the kernel, the other is upgrading everything - which may or may not upgrade the kernel.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way I see it, one is upgrading the kernel, the other is upgrading everything - which may or may not upgrade the kernel.

Agreed. By extension, both could upgrade the kernel, and so you should be able to check if the kernel was upgraded after either of them.


After the brick has rebooted (assuming you installed a new kernel version), press `About` on the brick's main menu and scroll down to "Kernel" to confirm it
has a current kernel.

{% include screenshot.html source="/images/brickman/about-kernel-version.png" caption="Brickman's about page" %}
Binary file added images/brickman/about-kernel-version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.