How To Install flashrom on Ubuntu 20.04

In this tutorial we learn how to install flashrom on Ubuntu 20.04. flashrom is Identify, read, write, erase, and verify BIOS/ROM/flash chips

Introduction

In this tutorial we learn how to install flashrom on Ubuntu 20.04.

What is flashrom

flashrom is:

flashrom is a tool for identifying, reading, writing, verifying and erasing flash chips. It’s often used to flash BIOS/EFI/coreboot/firmware/optionROM images in-system using a supported mainboard, but it also supports flashing of network cards (NICs), SATA controller cards, and other external devices which can program flash chips.

It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32/40/48, and BGA chips, which use various protocols such as LPC, FWH, parallel flash, or SPI.

The tool can be used to flash BIOS/firmware images for example – be it proprietary BIOS images or coreboot (previously known as LinuxBIOS) images.

It can also be used to read the current existing BIOS/firmware from a flash chip.

Currently supported programmers include:

  • internal (for in-system flashing in the mainboard)
  • dummy (virtual programmer for testing flashrom)
  • nic3com (for flash ROMs on 3COM network cards)
  • nicrealtek (for flash ROMs on Realtek and SMC 1211 network cards)
  • nicnatsemi (for flash ROMs on National Semiconductor DP838* network cards)
  • nicintel (for parallel flash ROMs on Intel 10/100Mbit network cards)
  • gfxnvidia (for flash ROMs on NVIDIA graphics cards)
  • drkaiser (for flash ROMs on Dr. Kaiser PC-Waechter PCI cards)
  • satasii (for flash ROMs on Silicon Image SATA/IDE controllers)
  • satamv (for flash ROMs on Marvell SATA controllers)
  • atahpt (for flash ROMs on Highpoint ATA/RAID controllers)
  • atavia (for flash ROMs on VIA VT6421A SATA controllers)
  • atapromise (for flash ROMs on Promise PDC2026x ATA/RAID controllers)
  • it8212 (for flash ROMs on ITE IT8212F ATA/RAID controller)
  • ft2232_spi (for SPI flash ROMs attached to an FT2232/FT4232H/FT232H family based USB SPI programmer), including the DLP Design DLP-USB1232H, FTDI FT2232H Mini-Module, FTDI FT4232H Mini-Module, openbiosprog-spi, Amontec JTAGkey/JTAGkey-tiny/JTAGkey-2, Dangerous Prototypes Bus Blaster, Olimex ARM-USB-TINY/-H, Olimex ARM-USB-OCD/-H, TIAO/DIYGADGET USB Multi-Protocol Adapter (TUMPA), TUMPA Lite, GOEPEL PicoTAP, Google Servo v1/v2, and FIC OpenMoko Neo1973 Debug board.
  • serprog (for flash ROMs attached to a programmer speaking serprog), including AVR flasher by Urja Rannikko, AVR flasher by eightdot, Arduino Mega flasher by fritz, InSystemFlasher by Juhana Helovuo, and atmegaXXu2-flasher by Stefan Tauner.
  • buspirate_spi (for SPI flash ROMs attached to a Bus Pirate)
  • dediprog (for SPI flash ROMs attached to a Dediprog SF100)
  • rayer_spi (for SPI flash ROMs attached to a RayeR parport based programmer)
  • pony_spi (for SPI flash ROMs attached to a SI-Prog serial port bitbanging adapter)
  • nicintel_spi (for SPI flash ROMs on Intel Gigabit network cards)
  • ogp_spi (for SPI flash ROMs on Open Graphics Project graphics card)
  • linux_spi (for SPI flash ROMs accessible via /dev/spidevX.Y on Linux)
  • usbblaster_spi (for SPI flash ROMs attached to an Altera USB-Blaster)
  • nicintel_eeprom (for SPI EEPROMs on Intel Gigabit network cards)
  • mstarddc_spi (for SPI flash ROMs accessible through DDC in MSTAR-equipped displays)
  • pickit2_spi (for SPI flash ROMs accessible via Microchip PICkit2)
  • ch341a_spi (for SPI flash ROMs attached to WCH CH341A)

There are three methods to install flashrom on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install flashrom Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install flashrom using apt-get by running the following command:

sudo apt-get -y install flashrom

Install flashrom Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install flashrom using apt by running the following command:

sudo apt -y install flashrom

Install flashrom Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install flashrom using aptitude by running the following command:

sudo aptitude -y install flashrom

How To Uninstall flashrom on Ubuntu 20.04

To uninstall only the flashrom package we can use the following command:

sudo apt-get remove flashrom

Uninstall flashrom And Its Dependencies

To uninstall flashrom and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove flashrom

Remove flashrom Configurations and Data

To remove flashrom configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge flashrom

Remove flashrom configuration, data, and all of its dependencies

We can use the following command to remove flashrom configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge flashrom

References

Summary

In this tutorial we learn how to install flashrom package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.