无法找到软件包 winehq-stable

无法找到软件包 winehq-stable

当尝试安装 Wine 时,终端回答错误路径:

E: Unable to locate package winehq-stable

它被安装了:

anatoly@anatoly-desktop:~$ sudo apt install --install-recommends winehq-stable
Reading package lists... Done

请问如何告诉终端去它的位置?

anatoly@anatoly-desktop:~$ wget -nc https://dl.winehq.org/wine-builds/winehq.key
--2019-02-28 11:00:11--  https://dl.winehq.org/wine-builds/winehq.key
Resolving dl.winehq.org (dl.winehq.org)... 151.101.14.217
Connecting to dl.winehq.org (dl.winehq.org)|151.101.14.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3220 (3.1K) [application/pgp-keys]
Saving to: ‘winehq.key’

winehq.key                 100%[========================================>]   3.14K  --.-KB/s    in 0s      

2019-02-28 11:00:12 (13.4 MB/s) - ‘winehq.key’ saved [3220/3220]

anatoly@anatoly-desktop:~$ sudo apt-key add winehq.key
[sudo] password for anatoly: 
OK
anatoly@anatoly-desktop:~$ sudo apt update
Hit:1 http://il.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://il.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://il.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
Reading package lists... Done                     
Building dependency tree       
Reading state information... Done
270 packages can be upgraded. Run 'apt list --upgradable' to see them.
anatoly@anatoly-desktop:~$ sudo apt install --install-recommends winehq-stable
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package winehq-stable
anatoly@anatoly-desktop:~$ 

答案1

您似乎跳过了该apt-add-repository命令。您仅将 WineHQ 存储库的密钥添加为受信任 ( apt-key add),但尚未添加存储库本身,因此 APT 仍然无法找到winehq-stable位于此存储库中的包。在WineHQ 指南,相关命令列在表中,而不是格式化为代码——这可能会产生误导。

根据您的apt update输出,您的 Ubuntu 版本是 18.04 (Bionic),因此运行这个应该是您的正确选择1

sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'

此后,您就可以运行:

sudo apt update
sudo apt install --install-recommends winehq-stable

它被安装了:

anatoly@anatoly-desktop:~$ sudo apt install --install-recommends winehq-stable
Reading package lists... Done

还没有……

Reading package lists... Done
Building dependency tree       
Reading state information... Done

告知您加载软件包数据库的进度。但是,此过程E:在您的情况下以错误 ( ) 结束,并且软件包尚未安装。


1apt-add-repository您还可以使用该命令的通用版本自动填写您的发布名称

sudo apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu/ $(lsb_release -c | cut -f2) main"

相关内容