LinuxCommandLibrary

pio-upgrade

Upgrade PlatformIO core and related components

TLDR

Update PlatformIO to the latest version

$ pio upgrade
copy

Update PlatformIO to the latest development (unstable) version
$ pio upgrade --dev
copy

SYNOPSIS

pio upgrade [OPTIONS]

PARAMETERS

--dev
    Upgrade to the latest development version.
Warning: May be unstable!

--force
    Force upgrade, ignoring potential errors.

--verbose
    Enable verbose output for detailed logs.

DESCRIPTION

The pio upgrade command updates the PlatformIO Core CLI tool to the most recent stable release. PlatformIO is an open-source ecosystem for IoT development, supporting embedded boards like Arduino, ESP32, STM32, and more. This command ensures users have access to the newest features, bug fixes, and library updates.

Running pio upgrade fetches the latest version from PyPI using pip under the hood, reinstalling or upgrading the platformio package. It's essential for maintaining a current development environment, especially when new board support or toolchain improvements are released. By default, it targets the stable channel; use --dev for cutting-edge builds.

The process is non-destructive to projects or installed platforms/packages, preserving local data in ~/.platformio. It's recommended to run periodically or after major announcements. On Linux, it works seamlessly in virtual environments, avoiding system Python conflicts. Post-upgrade, verify with pio --version. This keeps workflows efficient for firmware building, uploading, and debugging.

CAVEATS

Requires Python 3.6+ and pip. Use sudo only if installed system-wide (not recommended). Virtualenv advised to avoid conflicts. Dev channel risky for production.

EXAMPLES

pio upgrade
Stable upgrade.

pio upgrade --dev --verbose
Dev version with logs.

VERIFICATION

After upgrade: pio system info or pio --version.

HISTORY

Introduced in PlatformIO 1.0 (2014) by Atollic. Evolved with core releases; --dev added ~2016 for CI/testing. Now at version 6.x+, integral to 1M+ IoT projects.

SEE ALSO

pip(1), python(1)

Copied to clipboard