Linux Error: apt-get 404 not found [How to Solve]

When doing Linux work, I accidentally removed the vi environment and reinstalled it with various 404s, probably because ubuntu had not been updated for a long time and the software source had moved.

So.

sudo apt-get update

sudo apt-get install vim

At this point, I found that the installation was not successful

Maybe it’s a problem with sources.list, /etc/apt/sources.list is a file that stores the server addresses of third-party software sources. After this problem, I did some operations according to the online tutorials, and it seems that I accidentally lost the sources.list, and then I couldn’t even see the details page after finding vim in the software center.

So re-check.

Check the contents of your sources.list file sudo gedit/etc/apt/sources.list (you can only use gedit because you don’t have a vi environment) because there is no such file so the contents are empty.

Replace (or add) the following and save

 

deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

 

5. sudo apt-get update

6.sudo apt-get install vim

Done!

Similar Posts: