You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac M1上安装Ubuntu Desktop时执行sudo apt install ubuntu-desktop遇获取失败及权限问题求助

Mac M1上安装Ubuntu Desktop时执行sudo apt install ubuntu-desktop遇获取失败及权限问题求助

嘿,我看到你在Mac M1上装Ubuntu Desktop时遇上了双重麻烦——先是执行sudo apt install ubuntu-desktop提示“failed to fetch”获取失败,后来试着用apt-get update这类命令修复,又碰到了权限报错,真的挺折腾人的!咱们一步步来解决:

先搞定权限问题

你截图里的权限报错,大概率是因为执行apt/apt-get命令时没加sudo前缀!这些系统级的包管理操作必须要有管理员权限才能执行,以后所有相关命令都要加上sudo,比如:

  • sudo apt update(现在更推荐用apt而非apt-get,功能一致但更友好)
  • sudo apt update --fix-missing
  • sudo apt install ubuntu-desktop
  • sudo apt upgrade

再解决“failed to fetch”获取失败问题

这个问题大多和软件源有关,毕竟Mac M1是arm64架构,得确保用的是适配arm64的Ubuntu源:

  1. 先检查当前源是否适配:执行cat /etc/apt/sources.list,看看里面的源地址是不是带有ubuntu-ports这类arm64专属源的标识
  2. 如果源不对,先备份原来的源文件留个后手:
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    
  3. 替换成官方arm64源(以Ubuntu 22.04 jammy版本为例,如果你装的是其他版本,比如24.04是noble,记得改代号):
    sudo tee /etc/apt/sources.list <<EOF
    deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe multiverse
    deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe multiverse
    deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
    deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse
    EOF
    
  4. 要是官方源连接慢或者还是失败,可以换成国内的arm64镜像源(比如清华的),速度会快很多:
    sudo tee /etc/apt/sources.list <<EOF
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ jammy-security main restricted universe multiverse
    EOF
    
  5. 配置好源之后,先执行sudo apt update --fix-missing修复缺失的索引,然后再尝试安装桌面环境:sudo apt install ubuntu-desktop

最后再提醒一句:一定要确认你在Mac M1上装的是arm64版本的Ubuntu,要是不小心装了x86版本,那兼容问题会一堆,这也是很多M1用户踩过的坑!

备注:内容来源于stack exchange,提问作者jjj

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 14:48:11