0

Now I get this error:

WARNING:root:could not open file '/etc/apt/sources.list'

I would somehow like to get my original file back, plus some good instructions about how to install R that won't corrupt it.


ok - copied old version. Looks like the version after some program copied in the sources for the R package. Now get error:

sudo apt-get update
E: Malformed entry 50 in list file /etc/apt/sources.list (absolute Suite Component)
E: The list of sources could not be read.

Here is the file - what I think are lines 49 - 51. (Got an error about too many links when I tried to include the whole file)

# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ apt update sudo
# deb-src https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ sudo apt update

(The first and third line start with #)


Ok - now tried gedit with line numbers on as you suggested. Just deleted line 50. Now get update is running. Don't know if R will actually install but this solves the issue I posted here. How do I accept your answer? And thank you very much for all your help.

Zanna
  • 72,312

1 Answers1

1

From the comments...

In terminal do...

sudo ls -al /etc/apt/sources.list.*

answer:

-rw-rw-r-- 1 root root 3396 Oct 23 12:21 /etc/apt/sources.list.old 
-rw-r--r-- 1 root root  171 Oct 23 22:31 /etc/apt/sources.list.save 

funny enough, they're both the same date, but sources.list.old is much larger than sources.list.save, so I suspect that's the one we need. Let's briefly look at each one...

cd /etc/apt # change directory

cat sources.list.old # view the .old file

cat sources.list.save # view the .save file

Does the .old file look more complete? If so, do this...

sudo rm -i sources.list # remove the old empty sources.list

sudo cp sources.list.old sources.list # copy over a replacement

sudo apt-get update # update the software database

  • you shouldn't get any errors on this last step. If you do, put a list of the errors as an edit to your question... not in the comments, please.
heynnema
  • 73,649