无法安装gnuplot

无法安装gnuplot

我正在我的 Linux Mint (cinnamon) PC 上使用 gnuplot 和 Rust 来完成一个项目。然而,一旦我尝试显示图片,我就会得到:

called `Result::unwrap()` on an `Err` value: Couldn't spawn gnuplot. Make sure it is installed and available in PATH.
Cause: No such file or directory (os error 2) 

这看起来没问题,因为我还没有下载 Gnuplot。然而一旦我跑了

sudo apt install gnuplot

我明白了

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package gnuplot-x11 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

我不知道我现在应该做什么。感谢任何帮助,谢谢

编辑:我已经跑了

apt update

和适当的保单回报

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://packages.microsoft.com/repos/code stable/main armhf Packages
     release o=code stable,a=stable,n=stable,l=code stable,c=main,b=armhf
     origin packages.microsoft.com
 500 http://packages.microsoft.com/repos/code stable/main arm64 Packages
     release o=code stable,a=stable,n=stable,l=code stable,c=main,b=arm64
     origin packages.microsoft.com
 500 http://packages.microsoft.com/repos/code stable/main amd64 Packages
     release o=code stable,a=stable,n=stable,l=code stable,c=main,b=amd64
     origin packages.microsoft.com
 500 http://security.ubuntu.com/ubuntu jammy-security/multiverse i386 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=multiverse,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=multiverse,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/universe i386 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=universe,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=universe,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/restricted i386 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=restricted,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=restricted,b=amd64
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/main i386 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=main,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=main,b=amd64
     origin security.ubuntu.com
 500 https://mirror.init7.net/linuxmint vera/backport i386 Packages
     release v=21.1,o=linuxmint,a=vera,n=vera,l=linuxmint,c=backport,b=i386
     origin mirror.init7.net
 500 https://mirror.init7.net/linuxmint vera/backport amd64 Packages
     release v=21.1,o=linuxmint,a=vera,n=vera,l=linuxmint,c=backport,b=amd64
     origin mirror.init7.net
 500 https://mirror.init7.net/linuxmint vera/import i386 Packages
     release v=21.1,o=linuxmint,a=vera,n=vera,l=linuxmint,c=import,b=i386
     origin mirror.init7.net
 500 https://mirror.init7.net/linuxmint vera/import amd64 Packages
     release v=21.1,o=linuxmint,a=vera,n=vera,l=linuxmint,c=import,b=amd64
     origin mirror.init7.net
 700 https://mirror.init7.net/linuxmint vera/upstream i386 Packages
     release v=21.1,o=linuxmint,a=vera,n=vera,l=linuxmint,c=upstream,b=i386
     origin mirror.init7.net
 700 https://mirror.init7.net/linuxmint vera/upstream amd64 Packages
     release v=21.1,o=linuxmint,a=vera,n=vera,l=linuxmint,c=upstream,b=amd64
     origin mirror.init7.net
 500 https://mirror.init7.net/linuxmint vera/main i386 Packages
     release v=21.1,o=linuxmint,a=vera,n=vera,l=linuxmint,c=main,b=i386
     origin mirror.init7.net
 500 https://mirror.init7.net/linuxmint vera/main amd64 Packages
     release v=21.1,o=linuxmint,a=vera,n=vera,l=linuxmint,c=main,b=amd64
     origin mirror.init7.net
 500 https://dl.google.com/linux/chrome/deb stable/main amd64 Packages
     release v=1.0,o=Google LLC,a=stable,n=stable,l=Google,c=main,b=amd64
     origin dl.google.com
 500 https://cli.github.com/packages stable/main amd64 Packages
     release o=gh,n=stable,l=gh,c=main,b=amd64
     origin cli.github.com
 500 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages
     release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=main,b=i386
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
     release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=main,b=amd64
     origin security.ubuntu.com
 500 https://apt.kitware.com/ubuntu focal/main i386 Packages
     release o=ubuntu focal,a=focal,n=focal,l=ubuntu focal,c=main,b=i386
     origin apt.kitware.com
 500 https://apt.kitware.com/ubuntu focal/main amd64 Packages
     release o=ubuntu focal,a=focal,n=focal,l=ubuntu focal,c=main,b=amd64
     origin apt.kitware.com
 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ Packages
     release v=18.04,o=CRAN,a=bionic-cran40,n=bionic-cran40,l=CRAN,c=
     origin cloud.r-project.org
Pinned packages:
     snapd -> 2.58+22.04.1 with priority -10
     snapd -> 2.58+20.04.1 with priority -10

答案1

您的存储库设置缺少安装软件包所需的主 Ubuntu 存储库。查找包含jammy-security(可能是/etc/apt/sources.list.d/official-package-repositories.list)的文件:

grep -rl jammy-security /etc/apt/sources.list*

编辑它,使其包含以下行:

deb http://packages.linuxmint.com victoria main upstream import backport

deb http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

然后使用 进行更新sudo apt update,您应该能够安装该gnuplot包及其依赖项。

相关内容