7

I'm developing a proprietary cross-platform file manager called fman. I want to distribute it to Ubuntu users as a .deb file, which can be downloaded from my web site. I use fpm to create this file, which works without problems.

When the user installs fman, I want to add a file to /etc/apt/sources.list.d/ which points to my update server. This would allow the user to automatically update fman via Ubuntu's package manager (or via apt-get).

I did the obvious: I placed the file inside the .deb archive under etc/apt/sources.list.d/fman.list. The problem is: This file is not created under /etc/apt/... when the user installs fman from the .deb file.

When I do dpkg -x fman.deb some_dir/, the file fman.list is correctly created at some_dir/etc/apt/sources.list.d/fman.list. Likewise, when I do dpkg-query -L fman after installation, I do get the output

/.
/etc
/etc/apt
/etc/apt/sources.list.d
/etc/apt/sources.list.d/fman.list
...

I don't get any errors or warnings when I install the .deb file from the command line via sudo dpkg -i fman.deb. I tried increasing the log level via sudo dpkg -D 100 -i fman.deb. The only two lines of output pertaining to fman.list are:

D000100: setupvnamevbs main='/etc/apt/sources.list.d/fman.list' tmp='/etc/apt/sources.list.d/fman.list.dpkg-tmp' new='/etc/apt/sources.list.d/fman.list.dpkg-new'
D000100: setupvnamevbs main='/etc/apt/sources.list.d/fman.list' tmp='/etc/apt/sources.list.d/fman.list.dpkg-tmp' new='/etc/apt/sources.list.d/fman.list.dpkg-new'

At some previous point, I found a file /etc/apt/sources.list.d/fman.list.dpkg-dist. But that file was removed when I uninstalled fman. Subsequent installations of fman did not produce the file again.

Does anybody know why /etc/apt/sources.list.d/fman.list is not created when I install fman from a .deb file?

  • I just checked to make sure that fman.list isn't empty - it isn't. – Michael Herrmann Nov 14 '16 at 15:56
4

I figured out what the problem was.

I tested my .deb file via cycles of the following two commands:

  • sudo dpkg -i fman.deb
  • sudo dpkg -r fman (equivalently, sudo apt-get remove fman)

I found out that ... -r excludes config files. To also delete config files, one must use sudo dpkg -P fman.

During my testing, I must have manually deleted /etc/apt/sources.list.d/fman.list at some point. But dpkg (/apt) still remembered that it had installed that file, so it didn't re-install it the next time I did dpkg -i (equivalently, apt-get install).

The solution was therefore to call sudo dpkg -P fman. The next time I then did dpkg -i fman.deb the fman.list file was created as expected.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.