ubuntu22.04在线安装.net6SDK
- 运行以下命令,查找下载对应包文件
1sudo apt update && sudo apt install dotnet6
如果只想安装部分组件,命令如下:
1234// 仅安装特定组件
sudo apt install dotnet-sdk-6.0
sudo apt install dotnet-runtime-6.O
sudo apt install aspnetcore-runtime-6.0
但是运行命令后报错如下:12345678910111213141516N: 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通外网的.
查看安装是否成功1dotnet --info
出现版本信息,代表安装成功
- 卸载dotnet命令
12345dotnet --list-sdks # 查看下载的 sdk
dotnet --list-runtimes # 查看下载的 runtime
sudo apt remove dotnet-sdk-$版本号
sudo apt remove dotnet-runtime-$版本号
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· Apache Tomcat RCE漏洞复现(CVE-2025-24813)