On Ubuntu, the /etc/apt/source.list file is the AdvancePackaging Tool (APT) configuration file. This file stores all URLs of remote repositories where software packages and applications are installed. When you install the software using apt install or apt-get install, the apt tool looks for available remote repository links in the file /etc/apt/sources.list. Then search for the required software in the available remote repositories, start the download and install it.
You can add, remove, and modify remote repositories directly from the /etc/apt/sources.list file. Follow the steps below to edit the /etc/apt/sources.list file on your Ubuntu system.
Edit the /etc/apt/sources.list file
First, back up /etc/apt/sources.list using the following command:Open the terminal app (ctrl + alt + t) and run it
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
You can edit the file using the GUI and command line methods.
Also read: How to install ddgrDuckDuckGo search on Ubuntu-Search for DuckDuckGo from a Linux terminal
Edit the /etc/apt/sources.list GUI method.
Run this command in your terminal. Open the /etc/apt/sources.list file with a gedit text editor.
sudo gedit /etc/apt/sources.list
Here you can add, edit, and delete remote repository details.
Edit the /etc/apt/sources.list CLI method.
You can use the following commands in the terminal app to edit files using the command line editor nano.
sudo nano /etc/apt/sources.list
This will open the file nanocli editor. Make any necessary changes and save. that’s all.