2

I am unable to view any screen in my ubuntu, Also, when i do apt-get update.

I get below errors :-

  1. Failed to download repository information. Check your internet connection

Details

W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release Unable to find expected entry 'restricted/source/Sources' in Release file (Wrong sources.list entry or malformed file),
E:Some index files failed to download. They have been ignored , or old ones used instead.

How can i solve the issue.

1 Answers1

-4

Please try,

echo "deb http://archive.ubuntu.com/ubuntu trusty main universe restricted multiverse | sudo tee /etc/apt/sources.list
echo "deb http://archive.ubuntu.com/ubuntu trusty-updates main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list"
echo "deb http://archive.ubuntu.com/ubuntu trusty-security main universe restricted multiverse"  | sudo tee -a /etc/apt/sources.list"
echo "deb http://archive.ubuntu.com/ubuntu trusty-backports main universe restricted multiverse"  | sudo tee -a /etc/apt/sources.list"
sudo apt-get update
sudo apt-get upgrade

The first lines will reset your repository. Then the update might work.

mchid
  • 43,546
  • 8
  • 97
  • 150
  • 1
    After that, you sources.list, has only one entry. That's a very dangerous answer. – A.B. Jun 18 '15 at 04:44
  • 2
    I think you meant to use ">>" instead of ">" which will append to the file instead of truncating it before writing each line. – Nathan Osman Jun 18 '15 at 04:47
  • 2
    Test your answer and good luck. -1000 – A.B. Jun 18 '15 at 04:48
  • 2
    This answer is still incorrect. Shell redirection takes place before invoking sudo and therefore the command will fail since the invoking shell does not have permission to write to the file. – Nathan Osman Jun 18 '15 at 04:57
  • Adding to what Nathan Osman said, your edit is wrong. Appending the first line doesn't delete what's already present, so it doesn't reset anything. I rolled your answer back to my revision. – kos Jun 18 '15 at 05:08
  • This [ http://askubuntu.com/a/467824/259823 ] ans is also doesn't helpful and probably incorrect, and after using it my pc is now unable to update/install software. I don't have down vote permission till now so unable to do it. – Soumyadip Das Feb 11 '16 at 10:04