apt - Error when trying to reinstall package - Ask Ubuntu


i first run sudo dpkg --remove jenkins , response :

dpkg: error processing package jenkins (--remove): package in bad inconsistent state; should reinstall before attempting removal errors encountered while processing:     jenkins 

so try sudo apt-get --reinstall install jenkins , result :

    reading package lists... done     building dependency tree            reading state information... done following packages upgraded:   jenkins 1 upgraded, 0 newly installed, 0 remove , 0 not upgraded. 1 not installed or removed. need 0 b/68.9 mb of archives. after operation, 895 kb of additional disk space used. selecting unselected package jenkins. (reading database ... 346826 files , directories installed.) preparing unpack .../jenkins_2.19.1_all.deb ... not configured run standalone invoke-rc.d: initscript jenkins, action "stop" failed. dpkg: warning: subprocess old pre-removal script returned error exit status 1 dpkg: trying script new package instead ... not configured run standalone invoke-rc.d: initscript jenkins, action "stop" failed. dpkg: error processing archive /var/cache/apt/archives/jenkins_2.19.1_all.deb (--unpack):  subprocess new pre-removal script returned error exit status 1 not configured run standalone invoke-rc.d: initscript jenkins, action "start" failed. dpkg: error while cleaning up:  subprocess installed post-installation script returned error exit status 1 errors encountered while processing:  /var/cache/apt/archives/jenkins_2.19.1_all.deb e: sub-process /usr/bin/dpkg returned error code (1) 

anyone can tell should fix , update package ?

you have add --force-overwrite suffix on dpkg command, overwrite file causing error.

sudo dpkg -r --force-overwrite (file) 

in case,

sudo dpkg -r --force-overwrite /var/cache/apt/archives/jenkins_2.19.1_all.deb 

make sure fixed running:

sudo apt-get -f install 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User