On Sun, Jan 24, 2021 at 11:21:01PM -0800, Alex Chen wrote:
>    I am trying to create a Debian package, i.e. a .deb file, that can install 
>  software in Ubuntu. I put a the following files under the build directory:
> 
> build_dir/DEBIAN/control - Package configuration
> build_dir/DEBIAN/md5sums - MD5 checksums of every files to be installed.
> build_dir/DEBIAN/preinst postinst  prerm postrm - Pre/Post installation and 
> pre/post uninstallation scripts.

You should never create files under DEBIAN/ directly.  Build a proper
source package instead with the appropriate files under debian/, and
build binary packages from it using debuild.  See for instance
https://wiki.debian.org/Packaging/Intro.

> This what I have in the 'control' file
> =====
> Package: test-package
> Version: 1.0.0
> Architecture: amd64
> Pre-Depends: coreutils, libicu60, libfontconfig1, firewalld, unzip, zip, 
> curl, lapache2, apache2-bin
> ======
> 
> I thought packages listed in Pre-Depends field of a control file are supposed 
> to be installed by the system before it process the package itself, according 
> to this document: 
> https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends
>  
> <https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends>

Pre-Depends should only be used in rare circumstances.  You should
normally use Depends instead.  You also don't need to (and shouldn't)
explicitly depend on coreutils, since it's an essential package.

> I was able create the package with 'dpkg-deb --build build_dir' command 
> successfully, however I got the following dependency errors when I tried to 
> install the package in an Ubuntu server
> 
> ===========
> $ sudo dpkg -i test-package_1.0.0_amd64.deb 
> [sudo] password for tester
> dpkg: regarding test-package_1.0.0_amd64.deb containing test-package, 
> pre-dependency problem:
>  test-package pre-depends on libfontconfig1
>   libfontconfig1 is not installed.

dpkg -i won't acquire or install dependencies that aren't yet installed;
it only processes the files you give it.  You can use this instead,
which knows how to acquire and install dependencies as well as the
specific file you give it (note that the "./" is important so that apt
knows that you're talking about a file name rather than a package name):

  sudo apt install ./test-package_1.0.0_amd64.deb

-- 
Colin Watson (he/him)                              [cjwat...@ubuntu.com]

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss

Reply via email to