The method of replacing software sources in Ubuntu is as follows: 1. First, back up the original source list:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2. Edit the sources.list file:
sudo vim /etc/apt/sources.list
3. Change the default source address to a new source address, such as the official source:
deb Index of /ubuntu bionic main restricted deb Index of /ubuntu bionic-updates main restricted deb Index of /ubuntu bionic universe deb Index of /ubuntu bionic-updates universe deb Index of /ubuntu bionic multiverse deb Index of /ubuntu bionic-updates multiverse deb Index of /ubuntu bionic-backports main restricted universe multiverse deb Index of /ubuntu bionic-security main restricted deb Index of /ubuntu bionic-security universe deb Index of /ubuntu bionic-security multiverse
4. Save and exit. 5. Update package index:
sudo apt update
6. You can now use the new software source. 7. If you want to restore the original source, replace sources.list back to the backup of sources.list.bak. In this way, you can easily switch to official sources or other available sources to solve the problem that some software packages cannot be found.