1

I created a Debian package installer with a control file and desktop file, for a piece of software with no dependencies. It installs the software as expected, however the software does not seem to be removed when uninstalling with the software manager in Linux Mint. I am wondering if I am missing something i.e. how do I tell the package which files to remove? I don't have a postrm or prerm file. I created the package with:

dpkg-deb --build mydemopkg

The control file looks like:

Package: mydemopkg
Version: 1.0
Section: Office
Priority: optional
Architecture: all
Maintainer: xxxx yyyy <xxx@yyy.com>
Description: My blah blah program
 for blah blah
  • 1
    Does dpkg --remove mydemopkg or dpkg --purge mydemopkg remove the package as expected? If not you will need to create prerm and postrm scripts for dpkg to run. – kemotep Oct 15 '19 at 19:52
  • Yes, it does that (sudo dpkg --remove mydemopkg) with no errors. I guess the software manager needs something more. – gornvix Oct 15 '19 at 19:57
  • 1
    By software manager you mean apt? or some kind of graphical tool? The reason it is not removing your package because it has not been indexed by your package manager. It does not know it even exists because you did not install it using it. Custom packages can be uploaded to a custom repository (which can be a local file directory) to be managed via apt but otherwise the tool you want is dpkg. Should I create an answer out of these comments or are you continuing to have issues? – kemotep Oct 15 '19 at 20:02
  • 1
    Okay I will make an answer. Typically I complete all tasks like this via command-line but being able to double click a .deb, a custom built one at that, is pretty neat! – kemotep Oct 15 '19 at 20:14
  • 1
    What does dpkg -L mydemopkg output, when the package is installed? – Stephen Kitt Oct 16 '19 at 4:16
2

Custom packages, whether built by you or downloaded off the internet, are not maintained by your package manager without being set up to do so. However, the easiest way to manage one-off .deb files is via dpkg.

The relevant options for removing a given package are -r or --remove and -P or --purge.

The remove option removes everything but confiles. So you potentially do not have to reconfigure the software after re installation. The purge option removes everything related to that package that dpkg is aware of. If your package includes prerm and postrm script files they will be executed in that order as well during the package removal process when using dpkg.

Run either dpkg --remove mydemopkg or dpkg --purge mydemopkg to remove the package mydemopkg.

  • 2
    But that doesn’t explain why Software Manager isn’t uninstalling the software properly... It should end up using dpkg to remove the package, so there’s something weird going on. – Stephen Kitt Oct 15 '19 at 21:07
  • @StephenKitt I understand that my answer as it stands does not directly address the question. I will work on getting that right. – kemotep Oct 16 '19 at 1:03

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.