How to fix the sources list
2015-08-04 22:03
387 查看
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.
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.
相关文章推荐
- 7、C语言和设计模式(工厂模式)
- 读书笔记之c和指针(3)
- UI 04 target...action 设计模式
- 《高质量程序设计指南C/C++语言》 林锐 韩永泉编著 总结3
- javascript面向对象(学习和理解)
- 向文件输出数据的输出字节流
- iOS开发——UI进阶篇(十六)Quartz2D实战小例子
- leetcode:Compare Version Numbers
- POJ 1062:昂贵的聘礼
- balanced binary tree
- 缓存读者按照行读取文件
- 【转载】MFC动态创建控件及其消息响应函数
- POJ 1062:昂贵的聘礼
- [Linux--Shell]使用命令行关机或重启
- Ofbiz入门学习(开发第一个程序)
- HDU1.2.6 Buildings
- Oracle初探(五)
- POJ - 3159 Candies(差分约束系统)
- Linux 进程管理命令
- HDU 2578 Dating with girls(1) [补7-26]