apt 出現許多錯誤訊息 [論壇 - 新手村]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



apt 出現許多錯誤訊息
會員一級
註冊日期:
2017/7/1 13:22
所屬群組:
已註冊使用者
等級: 1
HP : 0 / 0
MP : 0 / 0
EXP: 0
離線
當執行apt-get install的時候會發生以下錯誤

1.Hash Sum Mismatch
2.Bad header line Bad header data [IP: 91.189.91.23 80]
3.0 OK [IP: 91.189.91.26 80]
4.Writing more data than expected (1077529 > 1076198) [IP: 91.189.91.26 80]

已試過
sudo rm -rf /var/lib/apt/lists

依舊不行

請問這有解法嗎??


(我使用的系統是ubuntu based的系統,但是這看起來比較像是ubuntu的問題所以才來這裡問問看QQ)

(先前在askubuntu問過了,原文連結:https://askubuntu.com/questions/930902/hash-sum-mismatch-etc)

[CommandLog](https://gist.github.com/james50428/cbc0671e8f8fef81d77b4a469e2c890e)
[source.list](https://gist.github.com/james50428/7736116efd644dd0362e3924a431e368)

2017/7/4 3:03
應用擴展 工具箱
回覆: apt 出現許多錯誤訊息
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 905
MP : 679 / 30282
EXP: 23
離線
racterub 寫到:
當執行apt-get install的時候會發生以下錯誤

1.Hash Sum Mismatch
2.Bad header line Bad header data [IP: 91.189.91.23 80]
3.0 OK [IP: 91.189.91.26 80]
4.Writing more data than expected (1077529 > 1076198) [IP: 91.189.91.26 80]

已試過
sudo rm -rf /var/lib/apt/lists

依舊不行

請問這有解法嗎??


(我使用的系統是ubuntu based的系統,但是這看起來比較像是ubuntu的問題所以才來這裡問問看QQ)

(先前在askubuntu問過了,原文連結:https://askubuntu.com/questions/930902/hash-sum-mismatch-etc)

[CommandLog](https://gist.github.com/james50428/cbc0671e8f8fef81d77b4a469e2c890e)
[source.list](https://gist.github.com/james50428/7736116efd644dd0362e3924a431e368)


推測您執行的當下,可能因為某個未知的因素,導致下載deb不完整,導致出現您提到的狀況。

您可以更改您的「sources.list」,修改成其他的「Repository來源」,然後再測測看,

或是您先再測看看您原本的「Repository」,目前應該是OK的。

否則您就需要排除您的網路環境是否正常不中斷。

================================================================================

若您要深究的話,提供下面的一些操作步驟給您參考,讓您有探索的起點。

根據您提供的「sources.list

其中有一行


deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted



所以您可以連到「http://us.archive.ubuntu.com/ubuntu/」。

主要您可以看到「dists」和「pool」兩個資料夾。

還有根據您提供的「log」。

以其中的一個為例


Get:5 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libxcb-render0 amd64 1.11.1-1ubuntu1 [11.4 kB]
Err:5 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libxcb-render0 amd64 1.11.1-1ubuntu1
Hash Sum mismatch



您可以連到「http://us.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/」。

然後執行下面指令,下載「http://us.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages.gz」這個檔案。


$ wget -c http://us.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages.gz



會下載一個檔案「Packages.gz」。

然後執行下面指令解開。


$ gunzip Packages.gz



會變成檔案「Packages」。

接下來執行


$ grep '^Package: libxcb-render0$' Packages -n -A 23



顯示


112074:Package: libxcb-render0
112075-Priority: optional
112076-Section: libs
112077-Installed-Size: 66
112078-Maintainer: Ubuntu X-SWAT <ubuntu-x@lists.ubuntu.com>
112079-Original-Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
112080-Architecture: amd64
112081-Source: libxcb
112082-Version: 1.11.1-1ubuntu1
112083-Depends: libc6 (>= 2.4), libxcb1 (>= 1.8)
112084-Filename: pool/main/libx/libxcb/libxcb-render0_1.11.1-1ubuntu1_amd64.deb
112085-Size: 11378
112086-MD5sum: 4f10102adb5701025ee33128ebf9c3fe
112087-SHA1: b5394cd8699a79d3e2d8288e71a22a132ee0f3e7
112088-SHA256: 5f751bea5ce0f42a70f85b6e70df393598d2d4b6bc8dbe133aa9d1d0d8002298
112089-Description: X C Binding, render extension
112090-Multi-Arch: same
112091-Homepage: http://xcb.freedesktop.org
112092-Description-md5: c5db612729adbe8a95b5f304a1c0e60b
112093-Bugs: https://bugs.launchpad.net/ubuntu/+filebug
112094-Origin: Ubuntu
112095-Supported: 5y
112096-Task: ubuntu-desktop, ubuntu-usb, print-server, kubuntu-desktop, edubuntu-desktop, edubuntu-usb, xubuntu-core, xubuntu-desktop, mythbuntu-frontend, mythbuntu-desktop, mythbuntu-backend-slave, mythbuntu-backend-master, lubuntu-core, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntu-gnome-desktop, ubuntu-sdk-libs, ubuntu-touch, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-mate-cloudtop
112097-



從一開始「sources.list」提到的「http://us.archive.ubuntu.com/ubuntu/

加上上面「Filename」那個欄位「pool/main/libx/libxcb/libxcb-render0_1.11.1-1ubuntu1_amd64.deb」

就可以產生下面這個連結「http://us.archive.ubuntu.com/ubuntu/pool/main/libx/libxcb/libxcb-render0_1.11.1-1ubuntu1_amd64.deb」

接下來執行下面指令,下載這個檔案,


$ wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/libx/libxcb/libxcb-render0_1.11.1-1ubuntu1_amd64.deb



正常的情況下,就會下載一個檔案「libxcb-render0_1.11.1-1ubuntu1_amd64.deb」。

接下來可以執行


$ md5sum libxcb-render0_1.11.1-1ubuntu1_amd64.deb



顯示


4f10102adb5701025ee33128ebf9c3fe libxcb-render0_1.11.1-1ubuntu1_amd64.deb



可以對照上面的「MD5sum: 4f10102adb5701025ee33128ebf9c3fe」。

執行


$ sha1sum libxcb-render0_1.11.1-1ubuntu1_amd64.deb



顯示


b5394cd8699a79d3e2d8288e71a22a132ee0f3e7 libxcb-render0_1.11.1-1ubuntu1_amd64.deb



對照上面的「SHA1: b5394cd8699a79d3e2d8288e71a22a132ee0f3e7」。

執行


$ sha256sum libxcb-render0_1.11.1-1ubuntu1_amd64.deb



顯示


5f751bea5ce0f42a70f85b6e70df393598d2d4b6bc8dbe133aa9d1d0d8002298 libxcb-render0_1.11.1-1ubuntu1_amd64.deb



對照上面的「SHA256: 5f751bea5ce0f42a70f85b6e70df393598d2d4b6bc8dbe133aa9d1d0d8002298」。


================================================================================

以我的環境「Xubuntu 16.04 amd64 英文界面」為例

我的「/etc/apt/sources.list」其中的一行設定如下


deb http://tw.archive.ubuntu.com/ubuntu/ xenial main restricted



執行


$ grep '^Package: libxcb-render0$' /var/lib/apt/lists/* -n



顯示


grep: /var/lib/apt/lists/lock: Permission denied
grep: /var/lib/apt/lists/partial: Permission denied
/var/lib/apt/lists/tw.archive.ubuntu.com_ubuntu_dists_xenial_main_binary-amd64_Packages:112074:Package: libxcb-render0
/var/lib/apt/lists/tw.archive.ubuntu.com_ubuntu_dists_xenial_main_binary-i386_Packages:111756:Package: libxcb-render0
/var/lib/apt/lists/tw.archive.ubuntu.com_ubuntu_dists_xenial_main_i18n_Translation-en:51092:Package: libxcb-render0



執行


$ grep '^Package: libxcb-render0$' /var/lib/apt/lists/tw.archive.ubuntu.com_ubuntu_dists_xenial_main_binary-amd64_Packages -n -A 23



顯示


112074:Package: libxcb-render0
112075-Priority: optional
112076-Section: libs
112077-Installed-Size: 66
112078-Maintainer: Ubuntu X-SWAT <ubuntu-x@lists.ubuntu.com>
112079-Original-Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
112080-Architecture: amd64
112081-Source: libxcb
112082-Version: 1.11.1-1ubuntu1
112083-Depends: libc6 (>= 2.4), libxcb1 (>= 1.8)
112084-Filename: pool/main/libx/libxcb/libxcb-render0_1.11.1-1ubuntu1_amd64.deb
112085-Size: 11378
112086-MD5sum: 4f10102adb5701025ee33128ebf9c3fe
112087-SHA1: b5394cd8699a79d3e2d8288e71a22a132ee0f3e7
112088-SHA256: 5f751bea5ce0f42a70f85b6e70df393598d2d4b6bc8dbe133aa9d1d0d8002298
112089-Description: X C Binding, render extension
112090-Multi-Arch: same
112091-Homepage: http://xcb.freedesktop.org
112092-Description-md5: c5db612729adbe8a95b5f304a1c0e60b
112093-Bugs: https://bugs.launchpad.net/ubuntu/+filebug
112094-Origin: Ubuntu
112095-Supported: 5y
112096-Task: ubuntu-desktop, ubuntu-usb, print-server, kubuntu-desktop, edubuntu-desktop, edubuntu-usb, xubuntu-core, xubuntu-desktop, mythbuntu-frontend, mythbuntu-desktop, mythbuntu-backend-slave, mythbuntu-backend-master, lubuntu-core, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntu-gnome-desktop, ubuntu-sdk-libs, ubuntu-touch, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-mate-cloudtop
112097-



執行


$ apt-cache show libxcb-render0



顯示


Package: libxcb-render0
Priority: optional
Section: libs
Installed-Size: 66
Maintainer: Ubuntu X-SWAT <ubuntu-x@lists.ubuntu.com>
Original-Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Architecture: amd64
Source: libxcb
Version: 1.11.1-1ubuntu1
Depends: libc6 (>= 2.4), libxcb1 (>= 1.8)
Filename: pool/main/libx/libxcb/libxcb-render0_1.11.1-1ubuntu1_amd64.deb
Size: 11378
MD5sum: 4f10102adb5701025ee33128ebf9c3fe
SHA1: b5394cd8699a79d3e2d8288e71a22a132ee0f3e7
SHA256: 5f751bea5ce0f42a70f85b6e70df393598d2d4b6bc8dbe133aa9d1d0d8002298
Description-en: X C Binding, render extension
This package contains the library files needed to run software using
libxcb-render, the render extension for the X C Binding.
.
The XCB library provides an interface to the X Window System protocol,
designed to replace the Xlib interface. XCB provides several advantages over
Xlib:
.
* Size: small library and lower memory footprint
* Latency hiding: batch several requests and wait for the replies later
* Direct protocol access: one-to-one mapping between interface and protocol
* Thread support: access XCB from multiple threads, with no explicit locking
* Easy creation of new extensions: automatically generates interface from
machine-parsable protocol descriptions
Description-md5: c5db612729adbe8a95b5f304a1c0e60b
Multi-Arch: same
Homepage: http://xcb.freedesktop.org
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: ubuntu-desktop, ubuntu-usb, print-server, kubuntu-desktop, edubuntu-desktop, edubuntu-usb, xubuntu-core, xubuntu-desktop, mythbuntu-frontend, mythbuntu-desktop, mythbuntu-backend-slave, mythbuntu-backend-master, lubuntu-core, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntu-gnome-desktop, ubuntu-sdk-libs, ubuntu-touch, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-mate-cloudtop



執行


$ apt-cache policy libxcb-render0



顯示


libxcb-render0:
  Installed: 1.11.1-1ubuntu1
  Candidate: 1.11.1-1ubuntu1
  Version table:
 *** 1.11.1-1ubuntu1 500
        500 http://tw.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status



若要重新安裝「libxcb-render0」這個套件,則是可以執行下面指令,也就是多加一個「--reinstall」。


$ sudo apt-get install libxcb-render0 --reinstall




## 一些路徑


* http://tw.archive.ubuntu.com/ubuntu/
* http://tw.archive.ubuntu.com/ubuntu/dists/
* http://tw.archive.ubuntu.com/ubuntu/pool/


* http://tw.archive.ubuntu.com/ubuntu/dists/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial-updates/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial-security/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial-backports/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial-proposed/


* http://tw.archive.ubuntu.com/ubuntu/pool/
* http://tw.archive.ubuntu.com/ubuntu/pool/main/
* http://tw.archive.ubuntu.com/ubuntu/pool/multiverse/
* http://tw.archive.ubuntu.com/ubuntu/pool/restricted/
* http://tw.archive.ubuntu.com/ubuntu/pool/universe/


* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/main/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages.gz


* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/main/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-i386/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-i386/Packages.gz


* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/main/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/main/source/
* http://tw.archive.ubuntu.com/ubuntu/dists/xenial/main/source/Sources.gz

================================================================================

關於「Packages.gz」如何產生,可以透過「dpkg-scanpackages」這個指令。

可以參考「這篇文章」的說明。
或是參考「Ubuntu Community Help Wiki / Repositories/Personal」的說明。

之前有一個「討論案例 - 簡易的建立自己的套件庫」,連結有紀錄在「[索引] 套件操作實務」。

================================================================================

## Manpages

$ man sources.list
$ man dpkg-scanpackages
$ man dpkg-scansources

$ man gzip
$ man gunzip

$ man md5sum
$ man sha1sum
$ man sha256sum

================================================================================

## Ubuntu Community Help Wiki

* Repositories
* Repositories/Ubuntu
* Repositories/CommandLine
* Repositories/Personal


* HowToMD5SUM
* HowToSHA256SUM

================================================================================

## Debian Wiki

* SourcesList
* DebianRepository

## Debian Reference

* 2.5. Debian package management internals

================================================================================

## 關鍵字查詢

* 查詢「debian repository
* 查詢「ubuntu repository
* Debian Repository HOWTO (Obsolete Documentation)


================================================================================

寫了一個簡單的範例放在「GitHub / demo-repository-ubuntu」上。

================================================================================

後記 (2017-10-06):

可以對照下面另一篇討論

* 回覆: ubuntu16.04 安裝 java9 出錯 - 「#2」,「#3」,「#4

================================================================================

後記 (2018-08-21):

* Ubuntu 18.04 LTS (Bionic Beaver) Released - 「#18

================================================================================

後記 (2018-12-23):

* #2 回覆: ubuntu 18.10 samba 無法安裝

================================================================================

以上提供參考

報告完畢


2017/7/5 9:56
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.