I have tried installing R (for the first time on Ubuntu) using this blog post.
First three steps ran fine:
sudo echo "deb " | sudo tee -a /etc/apt/sources.list
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -I got an 'OK'
Problem occurs in 4th step:
$ sudo apt-get update
E: Malformed entry 54 in list file /etc/apt/sources.list (Suite)
E: The list of sources could not be read.I looked up the file, which said, at line 54:
deb xenialThe file was unable to be modified.
At first, I thought it was because I couldn't have access to public key so I tried the steps suggested by the first answer: How do I import a public key?However
I also tested to see if it was a firewall issue by switching from my company connection to my phone hotspot and repeating the installation process, same errors occurred, so I don't think its due to having blocked port 11371.
Any ideas how I can fix the issue? I'm not sure how to correct line 54 (in terms of what to write and also how to get past the text edit restrictions).
51 Answer
Thanks @Pilot6 and @OrganicMarble for the suggestion. just for if anyone else is experiencing the issue: I ended up using
sudo nano /etc/apt/sources.listwhich helped me override permissions restriction and modify the file.
Just changed line 54 to
deb xenial[type] 1