安装最新版本的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/ 

有任何想法吗?

您需要通过软件包管理器卸载旧的Jenkins版本,而不仅仅是删除文件。 我不知道现在你会删除一些文件,但是你可以试试

 sudo apt-get purge jenkins 

然后再次尝试安装。

将来,你应该可以使用

 sudo apt-get install jenkins 

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