debファイルの依存関係の修正方法

プリンタドライバをインストールしようとしているのだが、依存関係が古いパッケージのままで困っていたが、以下のやり方で依存関係の内容が修正出来ることが分かった。大変参考になった。

まず、「端末」でダウンロードしたパッケージのあるディレクトリまで移動して下記コマンドを実行してください。パッケージを「pkg-temp」(名前は何でも構いません)という作業ディレクトリに展開します。
コード:

dpkg-deb -x fuji-xerox-docuprint-c2110_1.0-1_i386.deb pkg-temp/
dpkg-deb -e fuji-xerox-docuprint-c2110_1.0-1_i386.deb pkg-temp/DEBIAN

次にテキストエディタで「control」ファイルを編集します。
コード:

gedit pkg-temp/DEBIAN/control

変更箇所は「Version」と「Depends」となります。ここでは下記のようにVersionの「1.0-1」を「1.0-1.1」に、Dependsの「libcupsys2」を「libcups2」に変更しています。
コード:

Package: fuji-xerox-docuprint-c2110
Version: 1.0-1.1
Section: text
Priority: optional
Architecture: i386
Depends: libc6 (>= 2.3.2), libcups2 (>= 1.2.7) | libcupsys2-gnutls10 (>= 1.1.23-1), gs-esp | ghostscript
Installed-Size: 676
Maintainer: Fuji Xerox Co., Ltd. <>
Description: Printer Driver for Fuji Xerox DocuPrint C2110
 This package is a printer driver for Fuji Xerox DocuPrint C2110.

※ geditで保存するとバックアップファイルが作成されます。気になる方は適宜削除してください。

最後にパッケージを再構築してインストールします。構築するパッケージのバージョンに気をつけてください。
コード:

fakeroot dpkg-deb -b pkg-temp/ fuji-xerox-docuprint-c2110_1.0-1.1_i386.deb
sudo dpkg -i fuji-xerox-docuprint-c2110_1.0-1.1_i386.deb

This is a memo about modifying the information of dependency files in deb packages.