ubuntu22.04在线安装.net6SDK

  1. 运行以下命令,查找下载对应包文件
    1
    sudo apt update && sudo apt install dotnet6

    如果只想安装部分组件,命令如下:

    1
    2
    3
    4
    // 仅安装特定组件
    sudo apt install dotnet-sdk-6.0
    sudo apt install dotnet-runtime-6.O
    sudo apt install aspnetcore-runtime-6.0

     
    但是运行命令后报错如下:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is no longer signed.
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease  901   [IP: 122.229.31.17 80]
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    E: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is no longer signed.
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease  901   [IP: 122.229.31.17 80]
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease  901   [IP: 122.229.31.17 80]
    E: The repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' is no longer signed.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-security/InRelease  901   [IP: 122.229.31.17 80]
    E: The repository 'http://archive.ubuntu.com/ubuntu jammy-security InRelease' is no longer signed.
    N: Updating from such a repository can't be done securely, and is therefore disabled by default.
    N: See apt-secure(8) manpage for repository creation and user configuration details.

     ping了一下报错信息中的IP地址发现也是通的

     接着尝试网上找到的方法
    1.apt-get update 或者 apt-get clean或者 apt-get update,三个命令全部执行完成后,发现问题依旧
    2.运行修改的命令 apt-get update --fix-missing  问题未解决
    3.更换source  ,打开文件 sudo vim /etc/resolv.conf 并在文件中添加 nameserver 8.8.8.8,问题还是没有解决
    4.修改虚拟机的网络配置,修改为NAT,

     

    再次执行安装的代码

     成功执行,具体原因不太清楚两种网络方式有什么不同,两种都是可以ping通外网的.
     查看安装是否成功

    1
    dotnet --info

     出现版本信息,代表安装成功

     

  2. 卸载dotnet命令
    1
    2
    3
    4
    5
    dotnet --list-sdks # 查看下载的 sdk
    dotnet --list-runtimes # 查看下载的 runtime
     
    sudo apt remove dotnet-sdk-$版本号
    sudo apt remove dotnet-runtime-$版本号

     

posted @   “!”  阅读(371)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· Apache Tomcat RCE漏洞复现(CVE-2025-24813)
点击右上角即可分享
微信分享提示