0

I am trying to update my packages put I keep getting an error saying,

E: Malformed entry 52 in list file /etc/apt/sources.list (Component)
E: The list of sources could not be read

When I run

sudo nano /etc/apt/sources.list

I get these lines of code on line 52

deb http://cran.rstudio.com/bin/linux/ubuntu xenial 

deb http://cran.rstudio.com/bin/linux/ubuntu xenial Anyone have any ideas, I tried to write xenial partner but to no avail. Any help would be very much appreciated. Thanks

  • 1
    Are both on the same line 52? – George Udosen Mar 18 '17 at 20:10
  • Your line is missing a repo name like main, universe, restricted after it! Put it like this deb http://cran.rstudio.com/bin/linux/ubuntu xenial contrib and try again – George Udosen Mar 18 '17 at 20:13
  • 1
    More accurately, a dupe of http://askubuntu.com/questions/880355/malformed-entry-63-in-list-file-after-upgrading-to-gnome-16-04-01 – muru Mar 20 '17 at 11:51

1 Answers1

2

According to UBUNTU PACKAGES FOR R the correct deb entry for the cran repository for the xenial release is (note the trailing slash /)

deb http://cran.rstudio.com/bin/linux/ubuntu xenial/

This seems to be a rather obscure point of syntax: the general form for such entries is

deb [ option1=value1 option2=value2 ] uri suite [component1] [component2] [...]

however from man sources.list:

   The URI for the deb type must specify the base of the Debian
   distribution, from which APT will find the information it needs.  suite
   can specify an exact path, in which case the components must be omitted
   and suite must end with a slash (/). This is useful for the case when
   only a particular sub-directory of the archive denoted by the URI is of
   interest. If suite does not specify an exact path, at least one
   component must be present.

which is the case here.

steeldriver
  • 136,215
  • 21
  • 243
  • 336