目录

  • 1. 更新源
  • 2. 安装mono
    • 2.1. 安装必要软件包
    • 2.2. 导入源仓库的 GPG key
    • 2.3. 添加 Mono 源仓库到系统源
    • 2.4. 安装mono

系统:ubuntu16.04

由于mono版本较低,需要重新安装mono。当重新安装mono时,出现如下报错

The following packages have unmet dependencies:mono-complete : Depends: mono-runtime (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: mono-runtime-sgen (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: mono-llvm-support (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: libmono-2.0-1 (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: mono-utils (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: mono-devel (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: mono-mcs (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: mono-roslyn (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: mono-csharp-shell (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: mono-4.0-gac (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: mono-4.0-service (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: monodoc-base (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: monodoc-manual (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: libmono-cil-dev (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installedDepends: referenceassemblies-pcl but it is not going to be installedDepends: msbuild but it is not going to be installedDepends: ca-certificates-mono (= 6.12.0.122-0xamarin1+ubuntu1804b1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

出现E: Unable to correct problems, you have held broken packages.时,大概率是镜像源较老,导致有些源无法访问。

为顺利安装mono,我们进行如下步骤。

1. 更新源

参考博客《解决E: Unable to correct problems, you have held broken packages.(亲测有效)》

cd /etc/apt
sudo cp sources.list sources.list.backend
sudo vim sources.list

在其中添加镜像源

#添加阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse#中科大源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse#163源
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse#清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

保存,更新源

sudo apt-get update

2. 安装mono

参考博客《如何在 Ubuntu 20.04 上安装 Mono》

2.1. 安装必要软件包
sudo apt-get install dirmngr gnupg apt-transport-https ca-certificates software-properties-common
2.2. 导入源仓库的 GPG key
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

输出如下

gpg: key A6A19B38D3D831EF: public key "Xamarin Public Jenkins (auto-signing) <releng@xamarin.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
2.3. 添加 Mono 源仓库到系统源
sudo apt-add-repository 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main'

再次更新源

sudo apt-get update
2.4. 安装mono
sudo apt install mono-complete

安装过程较长,大概10个小时。

ubuntu 安装 mono报错 E: Unable to correct problems, you have held broken packages.相关推荐

  1. Ubuntu19.10 使用sudo apt-get install命令时报E: Unable to correct problems, you have held broken packages.

    使用sudo apt-get install命令时报 E: Unable to correct problems, you have held broken packages. 解决: .1.在官网源 ...

  2. E: Unable to correct problems, you have held broken packages

    原文: http://www.cnblogs.com/Aaron-agu/p/8862624.html E: Unable to correct problems, you have held bro ...

  3. 解决 E: Unable to correct problems, you have held broken packages. 问题

    参考: Unable to correct problems, you have held broken packages 环境 Ubuntu 14.04, 64bit 问题 在安装gcc-4.9的时 ...

  4. debian10 Unable to correct problems, you have held broken packages.

    今天在安装phpmyadmin时遇到Unable to correct problems, you have held broken packages. 解决方案 aptitude是功能极其强大的包管 ...

  5. ubuntu安装lrzsz报错“E: Unable to locate package”

    ubuntu安装上传文件包lrzsz的时候报错 "E: Unable to locate package" 先运行下面两个 apt-get update apt-get upgra ...

  6. open with code 报错没有项目_Python开发:解决Ubuntu安装tesserocr报错

    tesserocr是Python的一个OCR库, 其中OCR指的是光学字符识别,是指通过扫描字符,然后通过其形状将其翻译成电子文本的过程. tesserocr是tesseract做的一层Python ...

  7. Ubuntu安装tensorflow报错:tensorflow-xx.whl not a supported wheel on this platform

    解决Ubuntu安装tensorflow报错:tensorflow-0.5.0-cp27-none-linux_x86_64.whl is not a supported wheel on this ...

  8. Windows下安装RabbitMQ报错:unable to perform an operation on node时的解决方案

    Windows下安装RabbitMQ报错:unable to perform an operation on node时的解决方案 参考文章: (1)Windows下安装RabbitMQ报错:unab ...

  9. ubuntu安装celery报错 encountered error while generating package metadata

    ubuntu安装celery报错 encountered error while generating package metadata Preparing metadata (setup.py) . ...

最新文章

  1. app.listen(3000)与app是不一样的
  2. Linux Java Web 服务器搭建之tomcat安装
  3. 运维中心建设--数据管理
  4. 开源方案搭建可离线的精美矢量切片地图服务-1.开篇(附成果演示地址)
  5. 疫苗事件发生后,阿里工程师连夜做了一件小事
  6. Dynamics CRM2016 Update or Create parentcustomerid in Contact using web api
  7. 不看可惜!无需代码,小白都会的可视化大屏,领导不重用你都难
  8. C#面向对象方式设置、读取应用配置
  9. Japan树状数组求逆序数
  10. mac自带录屏截图功能怎么使用?好用吗?
  11. java学习——JavaScript入门
  12. 微型计算机启天m425显卡驱动,Lenovo联想启天M425台式机NVIDIA VGA驱动26.21.14.4223版For Win10-64(2020年4月7日发布)...
  13. java最新2019面试题
  14. windows系统背景淡绿护眼色设置
  15. think php入门,Thinkphp快速入门教程
  16. Qt之Q_OBJECT
  17. 小红书推广效果怎么样?如何进行小红书推广?
  18. 一起动才够嗨!Android CoordinatorLayout 自定义 Behavior
  19. python自动化工具之pywinauto(三)_自动化工具之三:pywinauto
  20. python集合增加元素_python集合的新增元素方法整理

热门文章

  1. postgresql 连接超时_关于超时:如何自动关闭PostgreSQL中的空闲连接?
  2. 代写python作业费用标准_代做159.272作业、代写Programming Paradigms作业、代做Python实验作业、代写Java/c++编程作业代写Database|代做R...
  3. python字符串匹配算法_Python实现字符串匹配算法
  4. SVO: Fast Semi-Direct Monocular Visual Odometry
  5. Exponential notation 思维题
  6. mybatis resultMap映射学习笔记
  7. 查看tensorflow版本以及路径:
  8. FreeRTOS 软件定时器使用
  9. ROS学习笔记三:创建ROS软件包
  10. Python之Numpy常用操作