Ubuntu

mesa-common-dev:未滿足的依賴項

  • June 16, 2021

我正在嘗試在 Ubuntu LTS 上安裝mesa-common-dev :

sudo apt-get install mesa-common-dev

但是,系統返回:

   The following packages have unmet dependencies:  
    mesa-common-dev : Depends: libgl-dev but it is not going to be installed
                      Depends: libglx-dev but it is not going to be installed
                      Depends: libglx-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

apt-cache 策略 mesa-common-dev

mesa-common-dev:
 Installed: (none)
 Candidate: 20.0.4-2ubuntu1
 Version table:
    20.0.4-2ubuntu1 500
       500 http://br.archive.ubuntu.com/ubuntu focal/main amd64 Packages

apt-cache 策略 libgl-dev

libgl-dev:
 Installed: 1.3.2-1~ubuntu0.20.04.1
 Candidate: 1.3.2-1~ubuntu0.20.04.1
 Version table:
*** 1.3.2-1~ubuntu0.20.04.1 100
       100 /var/lib/dpkg/status
    1.3.1-1 500
       500 http://br.archive.ubuntu.com/ubuntu focal/main amd64 Packages

apt-cache 策略 libglx-dev

libglx-dev:
 Installed: 1.3.2-1~ubuntu0.20.04.1
 Candidate: 1.3.2-1~ubuntu0.20.04.1
 Version table:
*** 1.3.2-1~ubuntu0.20.04.1 100
       100 /var/lib/dpkg/status
    1.3.1-1 500
       500 http://br.archive.ubuntu.com/ubuntu focal/main amd64 Packages

apt-cache 策略 libdrm-dev

libdrm-dev:
 Installed: (nenhum)
 Candidate: 2.4.101-2
 Version table:
    2.4.101-2 500
       500 http://br.archive.ubuntu.com/ubuntu focal/main amd64 Packages

太感謝了



grep -Rn –include=*.list ^

$$ ^# $$/etc/apt/

/etc/apt/sources.list:5:deb http://br.archive.ubuntu.com/ubuntu/ focal main restricted
/etc/apt/sources.list:15:deb http://br.archive.ubuntu.com/ubuntu/ focal universe
/etc/apt/sources.list:24:deb http://br.archive.ubuntu.com/ubuntu/ focal multiverse
/etc/apt/sources.list:42:deb http://security.ubuntu.com/ubuntu focal-security main restricted
/etc/apt/sources.list:44:deb http://security.ubuntu.com/ubuntu focal-security universe
/etc/apt/sources.list:46:deb http://security.ubuntu.com/ubuntu focal-security multiverse
/etc/apt/sources.list.d/google-chrome.list:3:deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
/etc/apt/sources.list.d/opera-stable.list:4:deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)
/etc/apt/sources.list.d/sublime-text.list:1:deb https://download.sublimetext.com/ apt/stable/
/etc/apt/sources.list.d/microsoft-edge-beta.list:3:deb [arch=amd64] http://packages.microsoft.com/repos/edge/ stable main


成功!!我加:

deb http://archive.ubuntu.com/ubuntu focus-updates 主要受限宇宙多元宇宙

source.list文件中。

謝謝你幫助我

focal-updates您的 , 中缺少/etc/apt/sources.list以糾正問題:

echo "deb http://archive.ubuntu.com/ubuntu focal-updates main restricted  universe multiverse" |\
sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install mesa-common-dev

引用自:https://unix.stackexchange.com/questions/654531