After following these commands from https://askubuntu.com/a/159371/63298, it removed my sources.list
and when I do sudo apt-get upgrade
, it's asking me to auto-remove the packages lost.
How do I revert my source.list
from the source.list.backup
? Now my source.list.d
is a directory and not a list.
With four commands:
Or move or copy your backup
The folder
/etc/apt/source.list.d
has always been a folder, a sub-folder of/etc/apt
. After the removal of/etc/apt/source.list
, the folder/etc/apt
usually contains only this folder.The
sources.list
can be generated in multiple ways. The GUI provided in ubuntu basically generates that file (it is in Settings -> Software). There is/usr/share/doc/apt/examples/sources.list
which is in all the proper format. You can copy the example file to original file,cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list
And there is also online generator https://repogen.simplylinux.ch/But your file should remain in
/etc/apt
directory. You can revert changes withsudo mv /etc/apt/sources.list.backup /etc/apt/sources.list
I managed to restore if after https://askubuntu.com/a/159371/63298 by: