<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks for the information Colin.  However, this is a binary package built from proprietary cross-platform source code.  <div class="">It is not open-source nor free software.  There is no up-stream source package.<br class=""><div class=""><br class=""></div><div class="">Please see my in-line comments below</div><div class=""><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>Alex</div></div></div></div></div><br class="Apple-interchange-newline">
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Jan 25, 2021, at 6:51 AM, Colin Watson <<a href="mailto:cjwatson@ubuntu.com" class="">cjwatson@ubuntu.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Sun, Jan 24, 2021 at 11:21:01PM -0800, Alex Chen wrote:<br class=""><blockquote type="cite" class="">   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:<br class=""><br class="">build_dir/DEBIAN/control - Package configuration<br class="">build_dir/DEBIAN/md5sums - MD5 checksums of every files to be installed.<br class="">build_dir/DEBIAN/preinst postinst  prerm postrm - Pre/Post installation and pre/post uninstallation scripts.<br class=""></blockquote><br class="">You should never create files under DEBIAN/ directly.  Build a proper<br class="">source package instead with the appropriate files under debian/, and<br class="">build binary packages from it using debuild.  See for instance<br class=""><a href="https://wiki.debian.org/Packaging/Intro" class="">https://wiki.debian.org/Packaging/Intro</a>.<br class=""><br class=""></div></div></blockquote><div><br class=""></div><div class="">It is not built from with 'configure' and 'make' from the source. The standard Linux build configuration does not apply.</div><div class="">It is packaged with a script following the descriptions in <a href="https://www.debian.org/doc/debian-policy/ch-binary.html#binary-packages" class="">https://www.debian.org/doc/debian-policy/ch-binary.html#binary-packages</a></div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div class=""><blockquote type="cite" class="">This what I have in the 'control' file<br class="">=====<br class="">Package: test-package<br class="">Version: 1.0.0<br class="">Architecture: amd64<br class="">Pre-Depends: coreutils, libicu60, libfontconfig1, firewalld, unzip, zip, curl, lapache2, apache2-bin<br class="">======<br class=""><br class="">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: <a href="https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends" class="">https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends</a> <<a href="https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends" class="">https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends</a>><br class=""></blockquote><br class="">Pre-Depends should only be used in rare circumstances.  You should<br class="">normally use Depends instead.  You also don't need to (and shouldn't)<br class="">explicitly depend on coreutils, since it's an essential package.<br class=""></div></div></blockquote><div><br class=""></div><div><div>In order for our software to function, several packages not usually present in a base system need to be installed first and according to the definition of 'Depends' and 'Pre-Depends', 'Pre-Depends' seems to be what is needed.</div><div><br class=""></div></div></div><div>Depends -  Requires other packages it depends on to be 'unpackaged' or 'configured',</div><div>'Pre-Depends' - Requires 'dpkg' to complete 'installation' of these packages before event installing the package itself.</div><div><br class=""></div><div><br class=""></div><div><dt style="caret-color: rgb(62, 67, 73); color: rgb(62, 67, 73); font-family: Arial, sans-serif; font-size: 14.399999618530273px;" class=""><code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Depends</span></code></dt><dd style="margin-top: 3px; margin-bottom: 10px; margin-left: 30px; -webkit-hyphens: auto; line-height: 1.5em; caret-color: rgb(62, 67, 73); color: rgb(62, 67, 73); font-family: Arial, sans-serif; font-size: 14.399999618530273px;" class=""><p style="margin-top: 0px; -webkit-hyphens: auto; line-height: 1.5em;" class="">This declares an absolute dependency. A package will not be configured unless all of the packages listed in its <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Depends</span></code> field have been correctly configured (unless there is a circular dependency as described above).</p><p style="-webkit-hyphens: auto; line-height: 1.5em;" class="">The <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Depends</span></code> field should be used if the depended-on package is required for the depending package to provide a significant amount of functionality.</p><p style="-webkit-hyphens: auto; line-height: 1.5em;" class="">The <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Depends</span></code> field should also be used if the <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">postinst</span></code> or <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">prerm</span></code> scripts require the depended-on package to be unpacked or configured in order to run. In the case of <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">postinst</span> <span class="pre" style="-webkit-hyphens: none;">configure</span></code>, the depended-on packages will be unpacked and configured first. (If both packages are involved in a dependency loop, this might not work as expected; see the explanation a few paragraphs back.) In the case of <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">prerm</span></code> or other <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">postinst</span></code> actions, the package dependencies will normally be at least unpacked, but they may be only “Half-Installed” if a previous upgrade of the dependency failed.</p><p style="-webkit-hyphens: auto; line-height: 1.5em;" class="">Finally, the <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Depends</span></code> field should be used if the depended-on package is needed by the <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">postrm</span></code> script to fully clean up after the package removal. There is no guarantee that package dependencies will be available when <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">postrm</span></code> is run, but the depended-on package is more likely to be available if the package declares a dependency (particularly in the case of <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">postrm</span><span class="pre" style="-webkit-hyphens: none;">remove</span></code>). The <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">postrm</span></code> script must gracefully skip actions that require a dependency if that dependency isn’t available.</p></dd><div><dt class=""><code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Pre-Depends</span></code></dt><dd style="margin-top: 3px; margin-bottom: 0px; margin-left: 30px; -webkit-hyphens: auto; line-height: 1.5em;" class=""><p style="margin-top: 0px; -webkit-hyphens: auto; line-height: 1.5em; caret-color: rgb(62, 67, 73); color: rgb(62, 67, 73); font-family: Arial, sans-serif; font-size: 14.399999618530273px;" class="">This field is like <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Depends</span></code>, except that it also forces <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">dpkg</span></code> to complete installation of the packages named before even starting the installation of the package which declares the pre-dependency, as follows:</p><p style="-webkit-hyphens: auto; line-height: 1.5em; caret-color: rgb(62, 67, 73); color: rgb(62, 67, 73); font-family: Arial, sans-serif; font-size: 14.399999618530273px;" class="">When a package declaring a pre-dependency is about to be <em class="">unpacked</em> the pre-dependency can be satisfied if the depended-on package is either fully configured, <em class="">or even if</em> the depended-on package(s) are only in the “Unpacked” or the “Half-Configured” state, provided that they have been configured correctly at some point in the past (and not removed or partially removed since). In this case, both the previously-configured and currently “Unpacked” or “Half-Configured” versions must satisfy any version clause in the <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Pre-Depends</span></code> field.</p><p style="-webkit-hyphens: auto; line-height: 1.5em; caret-color: rgb(62, 67, 73); color: rgb(62, 67, 73); font-family: Arial, sans-serif; font-size: 14.399999618530273px;" class="">When the package declaring a pre-dependency is about to be <em class="">configured</em>, the pre-dependency will be treated as a normal<code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Depends</span></code>. It will be considered satisfied only if the depended-on package has been correctly configured. However, unlike with <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Depends</span></code>, <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Pre-Depends</span></code> does not permit circular dependencies to be broken. If a circular dependency is encountered while attempting to honor <code class="literal notranslate docutils" style="background-color: rgb(236, 240, 243); color: rgb(34, 34, 34); font-size: 1.1em;"><span class="pre" style="-webkit-hyphens: none;">Pre-Depends</span></code>, the installation will be aborted.</p></dd></div><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">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<br class=""><br class="">===========<br class="">$ sudo dpkg -i test-package_1.0.0_amd64.deb <br class="">[sudo] password for tester<br class="">dpkg: regarding test-package_1.0.0_amd64.deb containing test-package, pre-dependency problem:<br class=""> test-package pre-depends on libfontconfig1<br class="">  libfontconfig1 is not installed.<br class=""></blockquote><br class="">dpkg -i won't acquire or install dependencies that aren't yet installed;<br class="">it only processes the files you give it.  You can use this instead,<br class="">which knows how to acquire and install dependencies as well as the<br class="">specific file you give it (note that the "./" is important so that apt<br class="">knows that you're talking about a file name rather than a package name):<br class=""><br class="">  sudo apt install ./test-package_1.0.0_amd64.deb<br class=""><br class=""></div></div></blockquote><div><br class=""></div><div>I will try 'apt' command instead of 'dpkg'.</div><div><br class=""></div><div>Thanks</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div class="">-- <br class="">Colin Watson (he/him)                              [<a href="mailto:cjwatson@ubuntu.com" class="">cjwatson@ubuntu.com</a>]<br class=""><br class="">-- <br class="">Ubuntu-devel-discuss mailing list<br class=""><a href="mailto:Ubuntu-devel-discuss@lists.ubuntu.com" class="">Ubuntu-devel-discuss@lists.ubuntu.com</a><br class="">Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss<br class=""></div></div></blockquote></div><br class=""></div></div></body></html>