apt-get安装失败 E: Unable to correct problems, you have held broken packages.

sudo apt-get update
sudo apt-get install aptitude

Copy

You can then use this to install the programs you want:

sudo aptitude install package-name

Copy

sudo apt-get -u dist-upgrade

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I see you have some dependency issues installing libosmesa6-dev. It could be that some packages are locked on your system and cannot be upgraded or removed. You can try the following steps to resolve this issue:

sudo apt-get -f install
sudo dpkg --configure -a
sudo apt-get -f install

Copy

sudo apt-get update
sudo apt-get install aptitude

Copy

sudo aptitude install libosmesa6-dev

Copy

  • aptitudeSome possible solutions are displayed and you are given the option to accept them. You can press Y or N to answer, or . to see more solutions. If you see a suitable solution, you can press Y to accept and continue with the installation.

  • If the above methods are not successful, you can try to delete some locked packages 3 4 . These packages may prevent you from installing libosmesa6-dev or its dependencies. You can list locked packages with the following command:

sudo apt-mark showhold

Copy

  • You can then use the following commands to unlock and remove these packages:
sudo apt-mark unhold package-name
sudo apt-get remove package-name

Copy

  • Finally, you can try installing libosmesa6-dev again and check if there are still dependency issues.

Guess you like

Origin blog.csdn.net/u010087338/article/details/132395335