8

在我的 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/

有任何想法吗?

4

2 回答 2

11

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

sudo apt-get purge jenkins

然后再次尝试安装。

将来,您应该可以使用

sudo apt-get install jenkins

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

于 2013-10-18T19:58:24.807 回答
3

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

$ mv /var/lib/dpkg/info/jenkins.* /tmp/
$ dpkg --remove --force-remove-reinstreq jenkins
$ dpkg --purge jenkins
于 2018-05-16T10:43:59.403 回答