Debian: "update-command-not-found" IOError: gzip 圧縮ファイルではありません。

Debian:

端末で任意のコマンドを実行し、次の応答を取得します。

使用可能なアプリケーションのデータベースが見つかりません。この問題を解決するには、rootとしてupdate-command-not-foundを実行します。

当然走った

更新コマンドが見つかりません。

ルートとして次のファイルを受け取り始めます。

http://http.debian.net/debian/dists/jessie/main/Contents-i386.gz
http://http.debian.net/debian/dists/jessie/contrib/Contents-i386.gz
http://http.debian.net/debian/dists/jessie/non-free/Contents-i386.gz

ただし、コマンドは完全に完了せず、代わりにこのエラーが発生しました。

I: Writing data for ftp.us.debian.org_debian_dists_jessie_main_Contents-i386.gz ...
Traceback (most recent call last):
File "/usr/sbin/update-command-not-found", line 95, in <module> write_db_apt_file()
File "/usr/sbin/update-command-not-found", line 72, in write_db_apt_file write_db_core(fobj)
File "/usr/sbin/update-command-not-found", line 39, in write_db_core for i in text:   File "/usr/lib/python2.7/gzip.py", line 462, in readline c = self.read(readsize)
File "/usr/lib/python2.7/gzip.py", line 268, in read self._read(readsize)
File "/usr/lib/python2.7/gzip.py", line 303, in _read self._read_gzip_header()
File "/usr/lib/python2.7/gzip.py", line 197, in _read_gzip_header raise IOError, 'Not a gzipped file' 
IOError: Not a gzipped file

ついています。検索更新コマンドが見つかりません。私はこの問題に対する解決策を探しましたが、肯定的な結果は得られませんでした。IOError:gzip圧縮ファイルではありません。Pythonプログラミングに関する質問について少し混乱しています。

この問題を解決するための回避策はありますか?これはDebian Jessie(8)を新しくインストールしたときに発生し、少なくともインストールされ、後でいくつかのDEとパッケージを追加/削除しました。

結果uname -a

Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt20-1+deb8u1 (2015-12-14) i686 GNU/Linux

結果lsb_release-rd

説明: DebianEdu/Skolelinux バージョン: 8.2

助けてくれてありがとう。

ベストアンサー1

私は見つけた更新コマンドが見つかりません。一部をダウンロードしましたディレクトリ-i386.gzファイルを送信する/var/cache/apt/apt ファイル/目次。なぜかダウンロードしたファイルに問題があるため、ファイルサイズが元のファイルと一致しません。この問題が発生する理由はまだ私にとって謎です。次のようにwgetを使用して手動でダウンロードする必要がありました(ダウンロードしたファイルの名前を変更するには-Oスイッチを使用)。

以下はコマンドです(コピーと貼り付け用)。

wget http://ftp.us.debian.org/debian/dists/jessie/main/Contents-i386.gz -O /var/cache/apt/apt-file/ftp.us.debian.org_debian_dists_jessie_main_Contents-i386.gz

残りのファイルについても同じことを行います。

wget http://http.debian.net/debian/dists/jessie/main/Contents-i386.gz -O /var/cache/apt/apt-file/http.debian.net_debian_dists_jessie_main_Contents-i386.gz
wget http://http.debian.net/debian/dists/jessie/contrib/Contents-i386.gz -O /var/cache/apt/apt-file/http.debian.net_debian_dists_jessie_contrib_Contents-i386.gz
wget http://http.debian.net/debian/dists/jessie/non-free/Contents-i386.gz -O /var/cache/apt/apt-file/http.debian.net_debian_dists_jessie_non-free_Contents-i386.gz

/var/cache/apt/apt ファイル/正しいファイルが含まれている場合は、このコマンドが正しいファイルをダウンロードして誤ったファイルで上書きするのを防ぐために、スイッチを使用update-command-not-foundして実行できます。-n

root@debian:/var/cache/apt# update-command-not-found -n
I: Writing data for ftp.us.debian.org_debian_dists_jessie_main_Contents-i386.gz ... . done
I: Writing data for http.debian.net_debian_dists_jessie_contrib_Contents-i386.gz ... . done
I: Writing data for http.debian.net_debian_dists_jessie_main_Contents-i386.gz ... . done
I: Writing data for ftp.us.debian.org_debian_dists_jessie-updates_main_Contents-i386.gz ... . done
I: Writing data for http.debian.net_debian_dists_jessie_non-free_Contents-i386.gz ... . done

注:以前の結果があったため、ディレクトリsecurity.debian.org_dists_jessie_updates_main_Contents-i386.gzから削除する必要がありました。/var/cache/apt/apt-file/wgetERROR 404: Not Found

おすすめ記事