How to Stop the Ubuntu ‘ModemManager’ Service from Auto-Probing Serial Ports

What is ModemManager?

In Ubuntu, ModemManager is a background system daemon responsible for managing mobile broadband interfaces (like 3G/4G/5G USB cellular modems). To do its job, ModemManager aggressively and automatically probes every single serial port (e.g., /dev/ttyUSB0 or /dev/ttyACM0) that is plugged into the computer to see if the device responds like a cellular modem.

While this is useful if you are actually using a mobile hotspot dongle, it is a nightmare if you are a developer or engineer working with microcontrollers (like Arduinos, ESP32s, or Raspberry Pis). When you plug in a microcontroller to flash new firmware, ModemManager immediately hijacks the serial port and starts sending random AT commands to it, causing your firmware uploads to fail, corrupting data, or making the device unresponsive. If you do not use cellular modems, you should completely remove this service.

How to Stop ModemManager from Probing Serial Ports

The safest and most permanent way to stop this interference is to disable and completely remove the ModemManager package from your Ubuntu system.

  1. Open your Ubuntu Terminal (shortcut: Ctrl + Alt + T).
  2. First, stop the service from running in the current session:
sudo systemctl stop ModemManager.service
  1. Next, disable it from starting up on the next boot:
sudo systemctl disable ModemManager.service
  1. Finally, completely purge the package from your system using APT:
sudo apt-get purge modemmanager
  1. (Optional) You can also remove any leftover dependencies that were installed alongside it:
sudo apt-get autoremove

Once removed, you can safely plug in your Arduinos, GPS modules, or serial adapters. The /dev/ttyUSB ports will remain completely free and available for your own software to use without any background interference.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.