1

I have a package and I use a shell script to install it on Ubuntu. I want to use a .deb file instead, and this software package has prerequisites including DOTNET and Docker.

What are the steps to make a .deb file for this purpose?

Alexis Wilke
  • 2,787
joel
  • 11
  • 2

1 Answers1

0

I actually have such a project here. Each time I create a new install of Ubuntu, I want to have a basic set of tools and a set of Debian packages installed in one go.

The project includes a script, bin/create-packages.sh, which I run to create the .deb package.

In my case, all the dependencies exist in the Ubuntu system, so I just have their names in the Depends: ... field of my package. This is found in the debian/control file. In my case, I two packages, one for non-GUI and one for GUI. The GUI has the following Depends field:

Depends: vim-gtk3, alex-tools, ${shlibs:Depends}, ${misc:Depends}

which forces the base package to be installed (alex-tools) and also I install the vim-gtk3 software. By default, gvim is not installed so that way I have it for free.

However, as Thomas Ward mentioned, if you need to do things such as install URLs to a different repository, that won't work in your .postinst script. This is because at the time you are installing a Debian package, the Debian environment is locked. So your package could install a script that the client has to run. Maybe that's the name of the command they have to run each time and the first time you detect that things are not 100% installed yet and you run that additional installation at that time.

If you are dealing with many non-free packages, it won't really be that practical either way. That being said, if you have some legal help, you may be able to get once package in place with all the necessary files in one place (i.e. extract the .NET files and install them in your repository and when you create the package, you have them at your disposal... legally, you are probably not allowed to do that without some proper agreement).

Alexis Wilke
  • 2,787