Как я могу исправить плохой коммерческий пакет deb?

653
kevinarpe

В .debпакете Citrix ICA Client (Receiver) 13 есть некоторые известные проблемы. Как мне внести изменения в пакет? Мне нужно удалить некоторые зависимости и изменить скрипт установки.

Ссылка: Как мне установить Citrix ICA Client (Receiver) 13 в 64-битном Linux Debian?

2

1 ответ на вопрос

3
kevinarpe

I am answering this question myself because others may find this information useful. This Q&A was inspired about another one: How do I install Citrix ICA Client (Receiver) 13 on Debian 64-bit Linux?

  1. Create a temp directory and copy the .deb file to it.
  2. Extract the .deb file: ar vx archive.deb
  3. Three files will appear:
    • debian-binary: Do not touch
    • control.tar.gz: Config and scripts to install and uninstall
      • This file may have a different extension, depending on the compression format used.
    • data.tar.gz: Files to be installed
      • This file may have a different extension, depending on the compression format used.

Both *.tar.gz files may different extensions, depending on the compression format used. The .deb format supports a few different ones. Also both *.tar.gz files are tarbombs, so all the files will explode to the same path. Better to create a temp directory, copy, then extract.

File control.tar.gz has two files good for hacking:

  • control: Contains package dependency list. You can add/remove dependencies.
  • postinst: Contains the post-installation script. You can add/remove commands.

Recreate the *.tar.gz files as: tar -czvf control.tar.gz * or (data.tar.gz)

Finally, create a new archive. Order is very important here: ar rv my_new_package.deb debian-binary control.tar.gz data.tar.gz

You can try your new package with these commands:

  • Uninstall existing package: apt-get remove $package_name
    • ... where $package_name is the name of your package, e.g., icaclient
  • Install new package: dpkg --install my_new_package.deb

Ref: http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/

Просто для добавления дополнительной информации, обратите внимание, что формат deb * не * фактически идентичен формату `ar`. Если вы вручную упаковываете дабы таким способом, то с этим обычно справится dpkg, но некоторые другие важные инструменты, такие как apt-ftparchive, с этим не справятся. Там, где это возможно, лучше распаковать с помощью `dpkg-deb -R mypkg.deb tempdir` и заново упаковать с помощью` dpkg-deb -b tempdir`. the paul 10 лет назад 1

Похожие вопросы