Ubuntu curl: (23) Failure writing output to destination 错误 - Ubuntu 22.04

Ubuntu22.04系统之下,curl命令默认是snap软件包管理系统的curl。
和传统apt下的curl相比功能比较鸡肋,这次在下载shell文件的时候居然还出现了”Ubuntu curl: (23) Failure writing output to destination”的错误。
卸载之后用apt重装,问题得以解决。

1
2
3
4
5
6
7
8
9
10
# 错误内容
root@ubuntu22:/tmp# curl -fsSL https://ollama.com/install.sh | sh
>>> Downloading ollama...
Warning: Failed to open the file /tmp/tmp.Kz9ivWXG2f/ollama: No such file or %##O#-#
Warning: directory
curl: (23) Failure writing output to destination

# 解决方法如下
sudo snap remove curl
sudo apt install curl