E: Malformed entry 1 in list file /etc/apt/sources.list.d/docker.list (URI parse), E:The list of sources could not be read

I am using Ubuntu 16.04 but I'm not a computing professinal at all and I'm trying to resolve an issue I have since several months know. It is know becoming a real problem for me as I'd like to install new packages.

3 months ago, I did some manipulations in my terminal. I don't even remember what I was trying to do but it had something to do with implementing a database dump for one of my applications.

Here is the history of the commands I've run and that ruined everything:

 1072  sudo apt-get update
 1073  deb http://ppa.launchpad.net/jonls/redshift-ppa/ubuntu 16.04 main 
 1074  sudo apt-get install redshift
 1075  sudo apt install redshift
 1076  sudo apt install redshift-gtk
 1077  HiSuite
 1078  sudo apt-get update
 1079  sudo apt-get install fakeroot
 1080  sudo apt-get build-essential
 1081  deb http://de.archive.ubuntu.com/ubuntu/ saucy-updates main restricted
 1082  sudo apt-get build-essential
 1083  sudo apt-get update
 1084  sudo apt-get build-essential
 1085  sudo vi /etc/apt/sources.list
 1086  deb http://ftp.debian.org/debian wheezy main
 1087  echo "deb http://ftp.debian.org/debian wheezy main" | sudo tee /etc/apt/sources.list.d/docker.list
 1088  echo "deb deb-src http://ftp.debian.org/debian wheezy main" | sudo tee /etc/apt/sources.list.d/docker.list
 1089  sudo apt-get update
 1090  sudo apt-get build-essential
 1091  echo "deb http://ftp.debian.org/debian wheezy main"
 1092  echo "deb deb-src http://ftp.debian.org/debian wheezy main"
 1093  sudo apt-get update
 1094  apt-get 
 1095  sudo apt-get update
 1096  cat -n /etc/apt/sources.list | grep "55"
 1097  cat -n /etc/apt/sources.list
 1098  lsb_release -c -s
 1099  sudo rm /etc/apt/sources.list
 1100  sudo -i software-properties-gtk
 1101  sudo sed -i "s/xenial/$(lsb_release -c -s)/" /etc/apt/sources.list
 1102  sudo -i software-properties-gtk
 1103  sudo sed -i "s/xenial/$(lsb_release -c -s)/" /etc/apt/sources.list
 1104  sudo mv /etc/apt/sources.list /etc/apt/sources.list.old
 1105  sudo apt-get install gksu
 1106  sudo sed -i "s/xenial/$(lsb_release -c -s)/" /etc/apt/sources.list
 1107  sudo rm /etc/apt/sources.list
 1108  sudo sed -i "s/xenial/$(lsb_release -c -s)/" /etc/apt/sources.list
 1109  sudo -i software-properties-gtk
 1110  /etc/apt/
 1111  ls
 1112  source
 1113  ..
 1114  sudo cp /etc/apt/sources.list  /etc/apt/sources.list.old
 1115  sudo gedit /etc/apt/sources.list
 1116  ls
 1117  cd home
 1118  ls
 1119  cd kenza
 1120  ls
 1121  sudo apt-get update
 1122  cat -n /etc/apt/sources.list
 1123  sudo -i software-properties-gtk
 1124  sudo apt-get update
 1125  ..
 1126  /etc/apt/
 1127  source
 1128  sudo gedit /etc/apt/sources.list
 1129  ..
 1130  cd home/kenza
 1131  sudo apt-get update
 1132  apt-get
 1133  sudo apt-get uprade
 1134  /etc/apt/
 1135  ls
 1136  sudo gedit /etc/apt/sources.list.old
 1137  sudo gedit /etc/apt/sources.list.save
 1138  ..
 1139  cd home/kenza
 1140  curl https://repogen.simplylinux.ch/txt/xenial/sources_ae6942a4ca69e6ca95d89a755f6959aa12396478.txt | sudo tee /etc/apt/sources.list
 1141  sudo apt-get update
 1142  sudo gedit /etc/apt/sources.list
 1143  sudo gedit /etc/apt/sources.list.d/docker.list
 1144  sudo apt-get update
 1145  sudo gedit /etc/apt/sources.list.d/docker.list

Now each time I try to run an apt-get command I have this result :

E: Malformed entry 1 in list file /etc/apt/sources.list.d/docker.list (URI parse)
E: The list of sources could not be read.

At the moment, I need to install libsqlite3-dev which is impossible.

Thanks a lot for your help!


Solution 1:

I met the same problem when I was installing Bazel. And I found it was because I missed a space when typing the following command

echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list

When running apt-get update or apt-get upgrade, the sources enumerated in /etc/apt/sources.list are read. It will show the error which you mentioned above.

Hope this will help.

reference