可能重复:
如何从我的 sources.list 中删除格式错误的行?
如何修复 sources.list 中的“格式错误的行”错误?
我使用 Ubuntu 已经快一年了,但我并不是一名程序员。最近我在更新所有内容时遇到了问题,软件管理器拒绝搜索更新,并给我以下回复:
Could not initialize the package information
An unresolvable problem occurred while initializing the package information.
Please report this bug against the update-manager package and include the following error message:
E:Malformed line 52 in source list /etc/apt/sources.list (absolute dist), E:The list of sources could not be read., E:The package lists or status file could not be parsed or opened.
有人能帮我吗?我只想更新到 12.04 并让它重新工作。提前谢谢
帕特里克
好的,这是我在gksudo gedit /etc/apt/sources.list
终端输入后得到的结果:
deb cdrom:[Ubuntu 12.04 LTS _Precise Pangolin_ - Release i386 (20120423)]/ precise main restricted
deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)]/ oneiric main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb htp://archive.ubuntu.com/ubuntu oneiric main restricted
deb-src htp://archive.ubuntu.com/ubuntu oneiric restricted main multiverse universe #Added by software-properties
## Major bug fix updates produced after the final release of the
## distribution.
deb htp://archive.ubuntu.com/ubuntu oneiric-updates main restricted
deb-src htp://archive.ubuntu.com/ubuntu oneiric-updates restricted main multiverse universe #Added by software-properties
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb htp://archive.ubuntu.com/ubuntu oneiric universe
deb htp://archive.ubuntu.com/ubuntu oneiric-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb htp://archive.ubuntu.com/ubuntu oneiric multiverse
deb htp://archive.ubuntu.com/ubuntu oneiric-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb htp://archive.ubuntu.com/ubuntu oneiric-backports main restricted universe multiverse
deb-src htp://archive.ubuntu.com/ubuntu oneiric-backports main restricted universe multiverse #Added by software-properties
deb htp://archive.ubuntu.com/ubuntu oneiric-security main restricted
deb-src htp://archive.ubuntu.com/ubuntu oneiric-security restricted main multiverse universe #Added by software-properties
deb htp://archive.ubuntu.com/ubuntu oneiric-security universe
deb htp://archive.ubuntu.com/ubuntu oneiric-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb htp://archive.canonical.com/ubuntu oneiric partner
deb-src htp://archive.canonical.com/ubuntu oneiric partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb htp://extras.ubuntu.com/ubuntu oneiric main
deb-src htp://extras.ubuntu.com/ubuntu oneiric main
deb htp://archive.canonical.com / natty partner
deb-src htp://archive.canonical.com / natty partner
deb htp://archive.ubuntu.com/ubuntu oneiric-proposed restricted main multiverse universe
Hope that helps.
好的伙计们,我刚刚通过反复试验删除了上述帖子文本中的几行。它不再起作用了,但不要问为什么它现在又起作用了。我很高兴它能起作用,但有人能向我解释一下,为什么吗?
我刚刚删除了以下行:deb-src htp://archive.canonical.com / natty partner
只是想至少尝试了解一下我的电脑以及它的功能。
答案1
你所有的台词都说htp://
!
- 是的
http
,这个小小的拼写错误可能会导致错误。 - 通过在终端中运行此命令来修复它:
sudo sed -i -e 's/htp/http/g' /etc/apt/sources.list
您的特定错误是由于此格式错误的行造成的:
德布htp://archive.canonical.com/整洁的合作伙伴
正确的存储库 URL 是http://archive.canonical.com/ubuntu
。