Results 1 to 7 of 7

Thread: which command can completely remove a package

  1. #1
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,572
    Distro
    Xubuntu 18.04 Bionic Beaver

    which command can completely remove a package

    Which command can completely remove a package when dpkg, apt-get, and aptitude all fail to?
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  2. #2
    Join Date
    Aug 2010
    Location
    Wales
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: which command can completely remove a package

    purge

    Code:
    sudo aptitude purge packagemane
    Perseverance will succeed (usually)
    ubuntu user -32597 - linux user - 526569
    Wireless Info Script
    Blog

  3. #3
    Join Date
    Aug 2006
    Beans
    13,033
    Distro
    Ubuntu Mate 18.04 Bionic Beaver

    Re: which command can completely remove a package

    If dpkg, apt-get, and aptitude all fail to remove a package, it must either a special case, or something is broken. You should provide more detailed info on the problem.

  4. #4
    Join Date
    Dec 2007
    Location
    The last place I look
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: which command can completely remove a package

    'apt-get remove' removes an app, but leaves any config files in system space.
    'apt-get purge' removes the app, and any systemspace config files, but leaves most userspace config files (since those are created at runtime, not at install time so the installer doesn't know they exist.)
    Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.

  5. #5
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,572
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: which command can completely remove a package

    Quote Originally Posted by mikewhatever View Post
    If dpkg, apt-get, and aptitude all fail to remove a package, it must either a special case, or something is broken. You should provide more detailed info on the problem.
    On 10.04.2 LTS amd64 server edition, freshly installed, installing package "nsd3" using "apt-get install nsd3" will fail. At this point all attempts to remove the package, including doing "purge" will fail. Apparently those attempts depend on the package being fully installed and/or the nsd daemon being runnable.

    Dare to try installing it yourself? It works OK on 9.10 server edition.

    So far the only thing I have found to do is re-install Ubuntu, which makes it very hard to figure out what can be given to this package to make its install successful.

    I suspect the nsd3 package is broken. But that's another issue. I do believe that there should be a way to remove a failed install, as long as what files it did put in place do not go beyond the set of files the package is designated to installed. This kind of forced remove might be best with a --force option or such. But something should be available. If the package installed a stray file somewhere, and that isn't in any list, then I would not blame the removal code for not getting it all removed (the focus is now on the installer which should have watched what all was installed).

    BTW, I eventually did figure out how to get around the install problem with the "nsd3" package. By creating a zone file and compiling it on another system (did it on a 9.10 server system here), and making a config file that correctly references it so no startup errors happen to the daemon, and putting that zone file in place (at "/etc/nsd3/nsd.conf"), it can be made to work. There is a sample zone file provided by the package (named differently) that is not complete enough to be used as is. Maybe the "nsd3" package needs to have a config file installed (it doesn't). But the existing sample one won't do the job.

    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  6. #6
    Join Date
    Aug 2006
    Beans
    13,033
    Distro
    Ubuntu Mate 18.04 Bionic Beaver

    Re: which command can completely remove a package

    Hi Skaperen, I've reported the problem to launchpad.
    https://bugs.launchpad.net/ubuntu/+s...d3/+bug/735128

    The way I was able to get rid of it was by removing the scripts that produced errors.
    Code:
    sudo rm /var/lib/dpkg/info/nsd3.prerm
    sudo rm /var/lib/dpkg/info/nsd3.postrm
    then purge the package:
    Code:
    sudo apt-get purge nsd3
    That leaves some files behind that can be located with 'locate nsd3' and removed manually.
    This is what's left behind:
    Code:
    $ locate nsd3
    /etc/nsd3
    /etc/cron.d/nsd3
    /etc/init.d/nsd3
    /etc/rc0.d/K20nsd3
    /etc/rc1.d/K20nsd3
    /etc/rc2.d/S20nsd3
    /etc/rc3.d/S20nsd3
    /etc/rc4.d/S20nsd3
    /etc/rc5.d/S20nsd3
    /etc/rc6.d/K20nsd3
    /usr/share/doc/nsd3
    /var/cache/apt/archives/nsd3_3.2.4-1_i386.deb
    /var/crash/nsd3.0.crash
    /var/lib/nsd3
    /var/lib/dpkg/info/nsd3.conffiles
    /var/lib/dpkg/info/nsd3.list
    /var/lib/dpkg/info/nsd3.md5sums
    /var/lib/dpkg/info/nsd3.postrm
    /var/lib/update-rc.d/nsd3
    to remove most of it:
    Code:
    sudo update-rc.d -f nsd3 remove
    Now, with the nsd3 package gone, I still get the following error when installing updates:
    Code:
    dpkg: unrecoverable fatal error, aborting:
     syntax error: invalid uid in statoverride file
    E: Sub-process /usr/bin/dpkg returned an error code (2)
    Removing the three nsd related lines from /var/lib/dpkg/statoverride fixes it.
    Last edited by mikewhatever; March 16th, 2011 at 12:19 PM.

  7. #7
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,572
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: which command can completely remove a package

    Thanks. I don't know enough about Debian packaging to have known what to do with those files.
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •