编辑

编辑

我刚刚在我的 raspberry pi 上安装了 64 位 ubuntu 服务器(带有官方的 imager 程序),开始使用它,但找不到许多软件包。例如ruby,,python3-libotrrent等等,我得到的是E: Unable to locate package libboost-pythonE: Package 'python3-libtorrent' has no installation candidate。您有什么解决方案吗,我之前使用过 raspbian,它能用,但速度较慢。谢谢回复!

编辑

我的 apt 更新输出:

Hit:1 http://ppa.launchpad.net/deluge-team/stable/ubuntu focal InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:3 http://ppa.launchpad.net/fish-shell/release-3/ubuntu focal InRelease
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [107 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [98.3 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [107 kB]
Fetched 312 kB in 2s (153 kB/s)  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

输出sudo apt install ruby

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package ruby 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

E: Package 'ruby' has no installation candidate

编辑2

添加以下行:

deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse

导致错误:

sudo apt update
Hit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:2 http://ppa.launchpad.net/deluge-team/stable/ubuntu focal InRelease                         
Hit:3 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease                                                                                
Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease                                                                              
Get:5 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]                                       
Hit:6 http://ppa.launchpad.net/fish-shell/release-3/ubuntu focal InRelease                      
Hit:7 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease                             
Get:8 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]     
Get:9 http://archive.ubuntu.com/ubuntu focal-updates InRelease [107 kB]
Ign:10 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages   
Get:11 http://archive.ubuntu.com/ubuntu focal/main Translation-en [506 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal/main arm64 c-n-f Metadata [28.6 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages [1300 B]
Get:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages [1300 B]
Get:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages [1300 B]
Get:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages [1300 B]
Get:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages [1300 B]
Get:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages [1300 B]
Ign:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages
Ign:20 http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages
Ign:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages
Ign:10 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages
Ign:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages
Ign:20 http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages
Ign:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages
Ign:10 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages
Ign:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages
Ign:20 http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages [139 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages [139 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages [139 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages [139 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages [139 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages [139 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages [139 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages [139 kB]
Ign:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages
Ign:30 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages
Ign:31 http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages
Ign:32 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages
Ign:10 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages
Ign:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages
Ign:20 http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages
Ign:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages
Ign:30 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages
Ign:31 http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages
Ign:32 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages
Ign:10 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages
Ign:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages
Ign:20 http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages
Ign:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages
Ign:30 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages
Ign:31 http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages
Ign:32 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages
Err:10 http://archive.ubuntu.com/ubuntu focal/main arm64 Packages
  404  Not Found [IP: 91.189.88.142 80]
Ign:33 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
Get:34 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [46.8 kB]
Get:35 http://security.ubuntu.com/ubuntu focal-security/main arm64 c-n-f Metadata [3224 B]
Get:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [932 B]
Get:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [932 B]
Get:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [932 B]
Get:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [932 B]
Get:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [932 B]
Get:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages [932 B]
Ign:13 http://archive.ubuntu.com/ubuntu focal/restricted arm64 Packages          
Ign:20 http://archive.ubuntu.com/ubuntu focal/universe arm64 Packages            
Ign:21 http://archive.ubuntu.com/ubuntu focal/multiverse arm64 Packages
Ign:30 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages        
Ign:31 http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages  
Ign:32 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages    
Ign:30 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages        
Ign:31 http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages
Ign:32 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages
Err:30 http://archive.ubuntu.com/ubuntu focal-updates/main arm64 Packages
  404  Not Found [IP: 91.189.88.142 80]
Ign:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
Ign:43 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
Ign:33 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
Ign:31 http://archive.ubuntu.com/ubuntu focal-updates/restricted arm64 Packages
Ign:32 http://archive.ubuntu.com/ubuntu focal-updates/universe arm64 Packages
Ign:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
Ign:43 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
Ign:33 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
Ign:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
Ign:43 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
Ign:33 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
Ign:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
Ign:43 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
Ign:33 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
Ign:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
Ign:43 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
Err:33 http://security.ubuntu.com/ubuntu focal-security/main arm64 Packages
  404  Not Found [IP: 91.189.91.39 80]
Ign:36 http://security.ubuntu.com/ubuntu focal-security/restricted arm64 Packages
Ign:43 http://security.ubuntu.com/ubuntu focal-security/universe arm64 Packages
Fetched 479 kB in 4s (109 kB/s)      
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.142 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.142 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/main/binary-arm64/Packages  404  Not Found [IP: 91.189.91.39 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

答案1

我查看了这两个指南。一个是Ubuntu,另一个是拉斯普比(均基于 Debian,因此大多数软件包相同,可以从常见来源安装)。

两者似乎都使用sudo apt install ruby-fullrubby-full,而不是 ruby​​。

如果这不起作用,您可以考虑使用(sudo snap install ruby –classic如果您同意使用 snap)。

在我的盒子上运行 apt list:

apt list ruby
Listing... Done
ruby/bionic 1:2.5.1 amd64

此外,您应该使用您的 Ubuntu Server OS 版本更新您的问题。

相关内容