How to fix the sources list

Sometimes the apt-get may not work, it is often caused by the misspelled sources list. In most cases, you can fix it by yourself.

In this guide, I will tell you where is sources list, and how to fix it.

WHERE IS SOURCES LIST
Sources list is located at “/etc/apt/” (File System->etc->apt), the main sources list is “sources.list”. And there will be other sources list under /etc/apt/sources.list.d/, all valid list should be end with “.list”.

HOW DOES SOURCES LIST LOOK LIKE
If you open your sources.list, a typical line will look like this:

deb http://archive.ubuntu.com/ubuntu natty main restricted

It is called an “Entry”, sources list is consists of a numbers of entries.

Every entry is made by four sections, these sections are separated by “space”. I used different color to distinguish difference sections.

The first section is represent the “Entry type”. “deb” means the list contains deb packages. Another value is “deb-src”, it means the deb packages’ source code.

The second section is the URL, it must be accessible.

The third is distribution code name, it depends on your current distribituion.

The forth section is the “components”, it can be several items.

So a complete and valid source entry will look like this:

Type: must be “deb” or “deb-src”
URL: must be an accessible url
Code name: “karmic”, “lucid”, “maverick” or ther Ubuntu code names.
Component name: if the entry is PPA, so it will always be “main”.
Now you know how to fix the sources list! Open your terminal, try to edit and correct it with root like this:

sudo gedit /etc/apt/sources.list (or other path)

If you have any other problem, please leave a comment to let me know.

How to fix the sources list的更多相关文章

  1. How to fix “Duplicate sources.list entry …” issue

    The correct format of repository source line is <type of repository>  <location>  <di ...

  2. Ubuntu 14.04.4官方默认更新源sources.list

    Ubuntu 14.04.4官方默认更新源sources.list # deb cdrom:[Ubuntu LTS _Trusty Tahr_ - Release amd64 (20160217.1) ...

  3. 关于ubuntu的sources.list总结

    一.作用 文件/etc/apt/sources.list是一个普通可编辑的文本文件,保存了ubuntu软件更新的源服务器的地址.和sources.list功能一样的是/etc/apt/sources. ...

  4. [转] 关于ubuntu的sources.list总结

    点击阅读原文 一.作用 文件/etc/apt/sources.list是一个普通可编辑的文本文件,保存了ubuntu软件更新的源服务器的地址.和sources.list功能一样的是/etc/apt/s ...

  5. 【转】关于Ubuntu的sources.list 的总结

    一.作用 文件/etc/apt/sources.list是一个普通可编辑的文本文件,保存了ubuntu软件更新的源服务器的地址.和sources.list功能一样的是/etc/apt/sources. ...

  6. Ubuntu14.04和16.04官方默认更新源sources.list和第三方源推荐(干货!)

    不多说,直接上干货! 写在前面:笔者由于还在学校学习,学校没有开发给Linux用的上网客户端,所以只能用在windows系统中通过安装虚拟机运行linux比较方便,但没有外网,只有学校的教育网,所以我 ...

  7. buntu14.04和16.04官方默认更新源sources.list和第三方源推荐(干货!)转

    配置完成后: sudo apt-get update 安装和删除软件: sudo apt-get install sudo apt-get remove buntu14.04和16.04官方默认更新源 ...

  8. 【转】stropts.h: No such file or directory – How to Fix

    原文地址:stropts.h: No such file or directory – How to Fix 作者:xjc2694 It is a known issue that modern Li ...

  9. Could not find modernizr-2.6.2 in any of the sources GitLab: API is not accessible

    Could not find modernizr-2.6.2 in any of the sources GitLab: API is not accessible bundle exec rake ...

随机推荐

  1. AccessHelper 需修改

    using System; using System.Collections.Generic; using System.Configuration; using System.Data; using ...

  2. 一类有依赖的树形背包dp方法

    失踪人口回归系列 这个标题是不是看起来很厉害呢233 给一道例题:有一个树,每一个节点代表一个物品,每个物品有重量和价值,每个物品必须先选父亲才能选自己.求给定重量内最大价值. 这题的思路十分的厉害. ...

  3. 【转】浅析Sql Server参数化查询

    转载至: http://www.cnblogs.com/lzrabbit/archive/2012/04/21/2460978.html 错误认识1.不需要防止sql注入的地方无需参数化 参数化查询就 ...

  4. linux不同角色server分区方案

    服务器角色 分区建议 优点    RAID方案 单机服务器 如8G内存,300G硬盘        /boot 100-200M swap 16G,内存大小8G*2 / 80G /var 20G(也可 ...

  5. 自己画WinForm 皮肤包括默认控件

    好久没来博客园,今天捣鼓到现在就是为了把之前的皮肤控件完善好, 之前也看了很多技术文章,大多数都是自己重写系统控件实现换肤,几乎没有像东日的(IrisSkin)控件一样 添加一个组件 把系统的皮肤全换 ...

  6. ArcGIS支持MongoDB数据源

    ArcGIS支持MongoDB数据源 自从NoSQL推出之后,MongoDB就作为比较杰出的代表受到广大用户的推崇,当然,与之而来的大数据的讨论也非常激烈,GIS数据源向来都是以海量来计算,所以,GI ...

  7. 简单Ztree的实现————不连接数据库版

    Ztree可以去官网去下载相应的版本和API,我这里就简单的介绍下它的实现以及因为Ztree的小例子印发的Js问题,稍后我会在博客中写JS的异步问题, 我这里用的是MVC4.0,好了正文开始,上代码 ...

  8. 曾经post为何只能通过form来提交

    当我们web程序的前台,需要有数据向后台发送时候,我们第一时间想到的就是,给我们所需要提交的用户名,密码之类的数据封装到一个<form>表单里面去,而封装完毕之后,我们需要给form的提交 ...

  9. eclipse的历史版本及下载

    有时候我们总会遇到在需要eclipse而无法及时找到的时候, 所以那些有用的链接, 是帮助我们能够及时找到我们想要版本的额最好方式 Eclipse 3.1 IO[木卫一,伊奥] 2005 http:/ ...

  10. RabbitMQ官方中文入门教程(PHP版) 第三部分:发布/订阅(Publish/Subscribe)

    发布/订阅 在上篇教程中,我们搭建了一个工作队列.每个任务之分发给一个工作者(worker).在本篇教程中,我们要做的之前完全不一样——分发一个消息给多个消费者(consumers).这种模式被称为“ ...