Score:0

Restoring the default repositories in WSL and reinstalling R

fo flag

I have made a similar question but it was closed here: Difficulties on trying to (re)install R

As I work in WSL I believe my situation is a bit specific. After uninstalling R and going through some tutorials as the one suggested to me (in the closed question above) I am still not able to reinstall R in WSL.

Right now I'm stuck in this part of a tutorial described here How do I restore the default repositories? because in WSL "Softwares Sources" window will not popup like in regular ubuntu OS. Probably must have some way for one to do that update in the command line, but I haven't found it so far.

In case I want to update source, from this step on:

~$ sudo mv /etc/apt/sources.list ~/
~$ sudo touch /etc/apt/sources.list
~$ lsb_release -c -s
bionic
~$ ###### Ubuntu Main Repos
~$ deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse

Command 'deb' not found, did you mean:

  command 'deb3' from deb quilt
  command 'debc' from deb devscripts
  command 'edb' from deb edb-debugger
  command 'dub' from deb dub
  command 'dex' from deb dex
  command 'xdeb' from deb xdeb
  command 'dab' from deb bsdgames
  command 'debi' from deb devscripts
  command 'dep' from deb go-dep
  command 'derb' from deb icu-devtools

Try: sudo apt install <deb name>

Some of my other logs:

$ sudo apt-get update
Hit:1 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu bionic InRelease
Hit:2 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ InRelease
Hit:3 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ InRelease
Hit:4 http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu bionic InRelease
Reading package lists... Done

[Should I try to fix these 4 Hits?]

I have noticed that there is still a directory called R which I do not know if is causing any conflict with me trying to reinstall R (so, maybe should I delete it manually?).

/etc/R$ ls
Makeconf  Renviron.site  Rprofile.site  ldpaths  repositories

Finally, at /etc/apt/sources.list.d there are several files that I don't know either if I should manually delete them.

/etc/apt/sources.list.d$ ls
c2d4u_team-ubuntu-c2d4u4_0_-bionic.list  c2d4u_team-ubuntu-c2d4u4_0_-bionic.list.save  webupd8team-ubuntu-sublime-text-2-bionic.list  webupd8team-ubuntu-sublime-text-2-bionic.list.save

Thanks for the answers, in advance!

FINAL EDIT

HUGE thanks to https://askubuntu.com/users/1165986/notthedr01ds for giving me clues. Helped me figure that deb lines are not commands.

I'll describe briefly what solved my issue:

#1 created a new file of sources.list in Notepad adding this text https://gist.github.com/h0bbel/4b28ede18d65c3527b11b12fa36aa8d1 on it. Because mine is Ubuntu 18.04.1 LTS Bionic Beaver. I've checked to not save the file as "sources.list.txt".

#2 moved the new sources.list to '/etc/apt/' by:

sudo mv /path/to/sources.list /etc/apt/sources.list

#3 Done. As I was looking for an answer to allow me to reinstall R it solved my problem. BTW, I follow this installation of R from cran:

https://cran.r-project.org/bin/linux/ubuntu/ and also troubleshooting from here: https://github.com/stan-dev/rstan/issues/863

NotTheDr01ds avatar
vn flag
The `deb` lines aren't commands; they are lines that should be in your `/etc/apt/sources.list`. However, I don't think that's your problem, even though someone marked it as a duplicate (but I'm not an `apt` expert by any means). It seems more likely to me that the [other duplicate](https://askubuntu.com/q/223237/1165986). I would suggest restoring your `/etc/apt/sources.list` (assuming that you backed it up as per the instructions), and then try some of the answers in the "Broken Packages" question.
NotTheDr01ds avatar
vn flag
I would start with the third answer down, personally -- `sudo apt-get autoremove` and see if that helps.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.