簡體   English   中英

Ubuntu中的apt-get沖突

[英]apt-get conflict in Ubuntu

我曾嘗試安裝mod_security,但它有錯誤,所以我嘗試了aptitude:

apt-get install libapache-mod-security
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libapache-mod-security : Depends: libapache2-modsecurity but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@srv16540:~# aptitude install libapache2-modsecurity
The following NEW packages will be installed:
  apache2.2-common{ab} libapache2-modsecurity modsecurity-crs{a}
0 packages upgraded, 3 newly installed, 0 to remove and 10 not upgraded.
Need to get 660 kB of archives. After unpacking 2,861 kB will be used.
The following packages have unmet dependencies:
 apache2 : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.4 is to be installed.
 apache2.2-common : Depends: apache2.2-bin (= 2.2.22-1ubuntu1.4) but 2.4.6-2~precise+1 is installed.
 apache2-bin : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.4 is to be installed.
 apache2-data : Conflicts: apache2.2-common but 2.2.22-1ubuntu1.4 is to be installed.
The following actions will resolve these dependencies:

     **Keep the following packages at their current version:**
1)     apache2.2-common [Not Installed]
2)     libapache2-modsecurity [Not Installed]
3)     modsecurity-crs [Not Installed]



Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.

我現在知道將以下軟件包保留在當前版本中的含義。

我想知道如果按是,會發生什么。 它會取代我目前的apache2嗎? 在做這個之前我需要備份嗎?

解答

我現在知道將以下軟件包保留在當前版本中的含義

aptitude正在嘗試解決依賴關系和可能的沖突以滿足您的安裝請求。 然后提出一個解決方案。 在您的特定情況下,它找到的第一個解決方案是保持其實際存在的一切,即保持當前版本 + [未安裝]的含義。

我想知道如果我按下是什么會發生什么,它會取代我當前的apache2嗎?

不,這個解決方案基本上什么都不做。

我以前需要備份嗎?

聽起來很無聊,從長遠來看,備份是節省時間的好策略。 如果你弄亂了重要的數據,那對你來說應該更重要。


CONTEXT

我已經看到其他場景使得aptitute提出了具有以下組合的解決方案:

  • 刪除以下包
  • 保留以下軟件包的當前版本
  • 保留以下依賴項未解析
  • 以下包裹已被保留
  • 將升級以下包
  • 以下軟件包已自動安裝,不再需要
  • 將安裝以下額外包
  • 推薦的套餐
  • 以下包將被刪除
  • (可能還有其他人)

在您的情況下,如果不是接受解決方案(或退出),而是通過按n拒絕它,那么aptitude將嘗試找出可能有用的另一個方案並再次向您提出。 您可以遍歷解決方案,如果其中任何一個滿足您,那么您可以接受它。


解決方案(?)

據我所知,你的輸出:

apache2.2-common:取決於:apache2.2-bin(= 2.2.22-1ubuntu1.4)但安裝了2.4.6-2~precision + 1。

您的問題是您安裝了apache2-2.4.6-2~precision + 1,這是標准Ubuntu精確存儲庫無法提供的(很可能是從此PPA安裝的),並且您要求的軟件包與另一個軟件包沖突。

我將看看有關如何刪除PPA答案,並在刪除該源后,我將使用此命令從標准repos重新安裝apache 2.2:

sudo aptitude install apache2

這正是它為我所做的:
$ sudo apt-get刪除apache2-bin
$ sudo apt-get autoremove
$ sudo apt-get install apache2

打開synaptic manager並搜索apache2.2-bin 標記為刪除。 然后

sudo apt-get install apache2

只需刪除/ var / lib / apt / lists目錄的所有內容:

sudo rm -rf /var/lib/apt/lists/*

然后運行:

sudo apt-get update

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM