2013-10-18 224 views
5

在我的Ubuntu機器上,我試圖做一個jenkins的本地安裝。我按照這個指南:安裝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/ 

任何想法?

回答

9

您需要通過軟件包管理器卸載舊的Jenkins版本,而不僅僅是刪除文件;我不確定您現在刪除了一些文件後會發生什麼,但您可以嘗試

sudo apt-get purge jenkins 

然後再次嘗試安裝。

在未來,你應該能夠使用

sudo apt-get install jenkins 

安裝新版本,並保持您的配置從舊版本。

+0

** E:更新命令不需要參數** –

+0

謝謝@IgorGanapolsky,我修復了我的答案。 –