【apt】解决 apt update 时 The method ‘ftp’ is unsupported and disabled by default 错误

1. 发现问题

在添加了一个 ftp 类型的 apt 源后,执行 sudo apt update 时遇到报错:

E: The method ‘ftp’ is unsupported and disabled by default. Consider switching to http(s). Set Dir::Bin::Methods::ftp to “ftp” to enable it again.

2. 解决问题

  • 创建文件:/etc/apt/apt.conf.d/99local-ftp
  • 写入内容:Dir::Bin::Methods::ftp “ftp”;
  • 重新执行 sudo apt update

3. 参考链接

https://askubuntu.com/questions/1187236/how-to-re-enable-ftp-on-secondary-ubuntu-debian-server-to-pull-updates-from-main

你可能感兴趣的:(linux)