linux - Trying to remove faulty installation of Jenkins - Super User


on old debian machine running squeeze have faulty installation of jenkins prevents me doing basic apt actions install, upgrade etc.

i have tried running

sudo dpkg --remove --force-remove-reinstreq jenkins  dpkg: warning: overriding problem because --force enabled: package in bad inconsistent state - should reinstall before attempting removal. (reading database ... 139335 files , directories installed.) removing jenkins ... found incorrect java version java version found: java version "1.5.0" gij (gnu libgcj) version 4.4.5 copyright (c) 2007 free  software foundation, inc. free software; see source copying  conditions. there no warranty; not merchantability or fitness  particular purpose. aborting invoke-rc.d: initscript jenkins, action "stop" failed. dpkg: error processing jenkins (--remove): subprocess installed pre-removal script returned error exit status 1 errors encountered while processing: jenkins 

i have tried upgrading java version following guidelines here: https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-debian-8

but similar error 1 above. how can proceed remove jenkins machine, have no need it?

update: after trying update java version instead:

found incorrect java version java version found: java version "1.6.0_18" openjdk runtime environment (icedtea6 1.8.13) (6b18-1.8.13-0+squeeze2) openjdk client vm (build 14.0-b16, mixed mode, sharing) 

edit: tried antonio's answer got following output:

traceback (most recent call last):     file "/usr/bin/apt-listchanges", line 33, in <module>     alchacks import * file "/usr/share/apt-listchanges/alchacks.py", line 32, in <module> sys.stderr.write(_("can't set locale; make sure $lc_* , $lang    correct!\n")) nameerror: name '_' not defined perl: warning: setting locale failed. perl: warning: please check locale settings: language = (unset), lc_all = (unset), lang = "sv_se.utf-8" supported , installed on system. perl: warning: falling standard locale ("c"). locale: cannot set lc_ctype default locale: no such file or directory locale: cannot set lc_messages default locale: no such file or directory locale: cannot set lc_all default locale: no such file or directory dpkg: error processing jenkins (--remove): package in bad inconsistent state - should reinstall before attempting removal. configured not write apport reports errors encountered while processing: jenkins e: sub-process /usr/bin/dpkg returned error code (1) 

i suffered same on debian 7 wheezy.

the problem have outdated java version. jenkins needs java 8. whenever try uninstall jenkins, system try execute uninstall script associated jenkins. script fails because don't have right java version , removal ended.

i first tried upgrade java, found same fail system tried stop jenkins before upgrading java. when jenkins wasn't running @ all, because rememeber? don't have right java version.

so trapped in kind of circular dependence, , need break it.

this worked me:

  1. edit /etc/init.d/jenkins . use vim, use prefered editor. remember need sudo privileges in order edit file.
  2. this script used start , stop jenkins, 1 realizing don't have right java version, etc.
  3. put whole file under comments. prepend symbol # every line. vim got done :%s/^/#/
  4. go last line (g in vim).
  5. remove # before exit 0, tell system script succesful.
  6. now can launch sudo aptitude remove jenkins

i hope it's useful. make me note if didn't work, please.


Comments

Post a Comment

Popular posts from this blog

Windows XP installation, no previous version of Windows NT - Super User

permissions - Mount is denied because the NTFS volume is already exclusively opened - Ask Ubuntu

software installation - How to install linux driver for a lb-link wireless usb adapter - Ask Ubuntu