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
  • 70,465
  • In terminal, do sudo ls -al /etc/apt/sources.list.*, and check the dates and sizes. If they're current enough, we can just copy one over to be sources.list. Show the list as an edit to your question. Also, gedit will show line numbers if you enable that in the prefs (and the plugin is enabed). Report back to @heynnema – heynnema Oct 26 '18 at 02:45
  • I know this is an old answer, but it should still work. https://askubuntu.com/questions/124017/how-do-i-restore-the-default-repositories – Terrance Oct 26 '18 at 02:54
  • -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

    /etc/apt/sources.list.d: total 8 drwxr-xr-x 2 root root 4096 Apr 20 2018 . drwxr-xr-x 6 root root 4096 Oct 23 22:30 ..

    – Gary 1008 Oct 26 '18 at 17:50

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
  • 70,711