Unable to force remove/purge package ubuntu 16.04
Solution 1
Read man dpkg
and man apt-get
. Your first command should have been sudo apt-get remove gitlab-ce
, then sudo apt-get purge gitlab-ce
. The autoremove
command just removes packages that were installed due to the requirements of another package, but the other package was uninstalled.
Solution 2
I've accepted @waltinator answer because by reading man dpkg
I've come up with a solution by using
sudo dpkg --remove --force-all gitlab-ce
I know the best solution for this is to reinstall
the application but I've had trouble with that and this command helped me, but I suggest people to try and reinstall
the application before remove/purge
it.
Solution 3
Try
find / -iname "gitlab"
after you find the folder where it was installed.
/opt/gitlab/bin/gitlab-ctl uninstall
Did you tried ?
sudo dpkg -r gitlab-ce
if yes and still the package is unable to be removed than you messed it by triggering commad :
sudo apt-get dist-upgrade
you should check your version now using command :
cat /etc/lsb-release
& edit your question back
Related videos on Youtube
copser
God forbid we have to move our fingers away from the hjkl position.
Updated on September 18, 2022Comments
-
copser over 1 year
I'm trying to remove
gitlab-ce
from my system, because I don't need it and I'm not able to do it, first I tried this:sudo apt-get --remove autoremove gitlab-ce Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: gitlab-ce 0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded. 1 not fully installed or removed. After this operation, 1076 MB disk space will be freed. Do you want to continue? [Y/n] Y dpkg: error processing package gitlab-ce (--remove): package is in a very bad inconsistent state; you should reinstall it before attempting a removal Errors were encountered while processing: gitlab-ce E: Sub-process /usr/bin/dpkg returned an error code (1)
Then I tried this
sudo dpkg --purge gitlab-ce dpkg: error processing package gitlab-ce (--purge): package is in a very bad inconsistent state; you should reinstall it before attempting a removal Errors were encountered while processing: gitlab-ce
The system is persistent is asking me to reinstall the app, and I don't want it, first I've tried to update my system using
sudo apt-get update && sudo apt-get dist-upgrade
because I've seen that my update is not working properly, so in the end I was left with some brokendpkg
packages, so I needed to solve that and now I'm trying to remove this forsaken app from my system, so what can I do to purge this out of my system.-
goo almost 7 yearsRead
man dpkg
and manapt-get
. Your first command should have beensudo apt-get remove gitlab-ce
, thensudo apt-get purge gitlab-ce
. Theautoremove
command just removes packages that were installed due to the requirements of another package, but the other package was uninstalled. -
Danibix almost 7 yearsHave you tried to reinstall
gitlab-ce
yet (as suggested by commands you issued)? Then you should be able to run commands provided in the answer without any problem. -
copser almost 7 yearsProblem with that is that my system crashes every time I try that, and yes I've tried it a couple of times
-
Panther almost 7 yearsIf all else fails follow this procedure - blog.bodhizazen.com/linux/…
-
-
copser almost 7 years
sudo apt-get remove gitlab-ce
andsudo apt-get purge gitlab-ce
are returningE: Sub-process /usr/bin/dpkg returned an error code (1)
so what is the clean way or cleaningdpkg
-
Artemmm almost 7 years@PetarP The clean way is reinstalling the package (
sudo apt install --reinstall packagename
) then remove/purge it. -
copser almost 7 yearsYes, doing that right now
-
copser almost 7 yearsI'm reinstalling it, but I'll try this if reinstall fails
-
Panther almost 7 yearsIf that fails see blog.bodhizazen.com/linux/…