Every time you connect to a new wireless network—whether it is at a coffee shop, an airport, or a friend’s house—Ubuntu automatically saves the network’s name (SSID) and password. This is a convenient feature that allows your computer to reconnect instantly the next time you are in range.
However, over time, your saved network list can become incredibly cluttered. More importantly, if a network changes its password, or if you connected to a public hotspot that you no longer trust, your computer may continuously try (and fail) to connect to it in the background, draining your battery and causing connectivity glitches.
In this guide, we will show you how to easily forget a saved Wi-Fi network in Ubuntu Linux, using both the graphical interface and the terminal.
Method 1: Forget a Wi-Fi Network via the Graphical Interface
If you are using the standard Ubuntu desktop environment (GNOME), managing your saved wireless networks is incredibly straightforward and does not require any command-line knowledge.
- Click on the System Menu in the top-right corner of your screen (where the battery, volume, and network icons are located).
- Click on the Wi-Fi section to expand it, and select Wi-Fi Settings. (Alternatively, you can open the main Settings app and click on “Wi-Fi” in the left-hand sidebar).
- In the Wi-Fi settings window, look at the top-right corner and click the three vertical dots (or the “Saved Networks” button in older versions of Ubuntu).
- Select Known Wi-Fi Networks.
- A list of every network your computer has ever connected to will appear.
- Scroll through the list to find the network you want to delete.
- Click the Forget button next to the network’s name.
The network and its associated password are now permanently deleted from your system. If you want to connect to it again in the future, you will need to select it from the available networks list and enter the password manually.
Method 2: Forget a Wi-Fi Network via the Terminal
If you are managing an Ubuntu server via SSH, or if you simply prefer the speed of the command line, you can manage your Wi-Fi connections using the powerful NetworkManager tool (nmcli).
First, you need to see exactly what networks your system remembers.
- Open your terminal by pressing Ctrl + Alt + T.
- Type the following command and press Enter:
nmcli connection show
The terminal will output a list of all saved connections. Look at the column on the far left (the “NAME” column) to find the exact SSID of the network you wish to delete.
Once you know the name, use the delete command. For example, if you want to forget a network named “Starbucks_Guest”, you would type:
nmcli connection delete "Starbucks_Guest"
Note: If the network name contains spaces, you must wrap it in quotation marks (e.g., “Airport Free Wifi”).
Press Enter. The terminal will confirm that the connection has been successfully deleted.
Why Did My Network Not Delete?
If you used the terminal method and received a “Permission denied” error, it means the network profile was created by a different user or an administrator. To bypass this and force the deletion, simply add sudo to the beginning of the command:
sudo nmcli connection delete "Network_Name"
By regularly clearing out old and unused wireless networks, you can ensure your Ubuntu machine connects faster, stays secure, and never wastes battery trying to negotiate with outdated access points.