How to restore my backup copy of sources.list ?
Hi all,
I followed this instruction on some guide- "Make a backup copy of your current sources.list file sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak " and afterwards I made a mistake in creating a new line in the sources.list Now when I enter sudo apt-get update, I get "E: Type 'new' is not known on line 52 in source list /etc/apt/sources.list E: The list of sources could not be read." How can I restore that backup easily? thanks!! |
The reverse operation is:
Code:
sudo cp /etc/apt/sources.list.bak /etc/apt/sources.list However, perhaps it is best to try and resolve the problem first. Which distro/version are you using? Can you please paste the output from: Code:
inxi -r |
hmm, the inxi command doesn't work for me:
The program 'inxi' is currently not installed. You can install it by typing: sudo apt install inxi I have ubuntu 16.04 LTS, thanks |
No problem. In that case,
Code:
cat /etc/apt/sources.list |
Quote:
E: The list of sources could not be read." when I try to update software |
Do not try to update software for the moment.
Please paste the output from the command I gave you in my last post. |
Oh ok, there you go:
# deb cdrom:[Ubuntu 16.04.4 LTS _Xenial Xerus_ - Release amd64 (20180228)]/ xenial main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://de.archive.ubuntu.com/ubuntu/ xenial main restricted deb-src http://de.archive.ubuntu.com/ubuntu/ xenial multiverse restricted universe main ## Major bug fix updates produced after the final release of the ## distribution. deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates main restricted deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates multiverse restricted universe main ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://de.archive.ubuntu.com/ubuntu/ xenial universe # deb-src http://de.archive.ubuntu.com/ubuntu/ xenial universe deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates universe # deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://de.archive.ubuntu.com/ubuntu/ xenial multiverse # deb-src http://de.archive.ubuntu.com/ubuntu/ xenial multiverse deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates multiverse # deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://de.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. deb http://archive.canonical.com/ubuntu xenial partner deb-src http://archive.canonical.com/ubuntu xenial partner deb http://security.ubuntu.com/ubuntu xenial-security main restricted deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse restricted universe main deb http://security.ubuntu.com/ubuntu xenial-security universe # deb-src http://security.ubuntu.com/ubuntu xenial-security universe deb http://security.ubuntu.com/ubuntu xenial-security multiverse # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse new line of text |
Thanks. Using your favourite text editor, edit that file (you will need to do so as root, i.e. with sudo) and remove the line at the bottom that says "new line of text".
Out of interest, what were you trying to do? For reference purposes, here is the default sources.list for Ubuntu 16.04: https://gist.github.com/rohitrawat/6...3eac3a11d4afc1 |
Quote:
I already tried to locate the line "new line of text" in the sources.list document but there isn't one! I was trying to install the Windscribe VPN service. |
Edit the file with the following command (it is a system file so you need to use sudo to edit it as root):
Code:
sudo gedit /etc/apt/sources.list |
nevermind I accessed the right document now and found the line. With sudo probably means with the terminal with echo command right? How do I edit specifically the 52nd line? or should I echo the list that you linked to?
I just don't know syntaxes by myself... thank you |
Quote:
|
Quote:
|
Quote:
Code:
sudo gedit /etc/apt/sources.list |
Quote:
|
All times are GMT -5. The time now is 11:52 PM. |