Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems installing latest version of jenkins

Tags:

jenkins

ubuntu

On my Ubuntu machine I am trying to do a local install of jenkins. I have followed this guide:

https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu

But when I run sudo apt-get install jenkins I get this error:

After this operation, 66.4 MB of additional disk space will be used.
(Reading database ... 303314 files and directories currently installed.)
Preparing to replace jenkins 1.480.3+dfsg-1~exp2 (using .../archives/jenkins_1.535_all.deb) ...
Unpacking replacement jenkins ...
dpkg: error processing /var/cache/apt/archives/jenkins_1.535_all.deb (--unpack):
 trying to overwrite '/usr/share/jenkins/jenkins.war', which is also in package jenkins-common 1.480.3+dfsg-1~exp2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
jenkins stop/waiting
Errors were encountered while processing:
 /var/cache/apt/archives/jenkins_1.535_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

It seems that an older installation is blocking the install. I have tried to delete:

/var/lib/jenkins
/usr/share/jenkins/

Any ideas?

like image 506
u123 Avatar asked Oct 18 '13 19:10

u123


2 Answers

You need to uninstall the old Jenkins version via the package manager, not just delete the files; I'm not sure what will happen now that you've deleted some files, but you can try

sudo apt-get purge jenkins

Then try the install again.

In future, you should be able to use

sudo apt-get install jenkins

to install a new version and keep your configuration from the old version.

like image 54
gareth_bowles Avatar answered Sep 27 '22 22:09

gareth_bowles


In my case(debian 7.0) this solution works well

$ mv /var/lib/dpkg/info/jenkins.* /tmp/
$ dpkg --remove --force-remove-reinstreq jenkins
$ dpkg --purge jenkins
like image 23
Vishnu Avatar answered Sep 27 '22 20:09

Vishnu