安装最新版本的詹金斯的问题

时间:2013-10-18 19:46:55

标签: ubuntu jenkins

在我的Ubuntu机器上,我正在尝试本地安装jenkins。我遵循了这个指南:

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

但是当我运行sudo apt-get install jenkins时,我收到此错误:

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)

似乎较旧的安装阻止了安装。我试图删除:

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

有什么想法吗?

2 个答案:

答案 0 :(得分:11)

您需要通过包管理器卸载旧的Jenkins版本,而不仅仅是删除文件;我不确定你删除了一些文件后会发生什么,但你可以试试

sudo apt-get purge jenkins

然后再次尝试安装。

将来,你应该可以使用

sudo apt-get install jenkins

安装新版本并保持旧版本的配置。

答案 1 :(得分:2)

在我的情况下(debian 7.0),此解决方案效果很好

$ mv /var/lib/dpkg/info/jenkins.* /tmp/
$ dpkg --remove --force-remove-reinstreq jenkins
$ dpkg --purge jenkins