How to fix the sources list

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.

转载于:https://www.cnblogs.com/liuhui0622/p/4703273.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值