3

When attempting to install Wine, Terminal answers about the wrong path:

E: Unable to locate package winehq-stable

BUT it was installed:

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

Please how to tell Terminal to go to its place?

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:~$ 
4
  • 2
    Check your mirror is up-to-date (launchpad.net/ubuntu/+archivemirrors) The only mirror I see for Israel (IL being your country) is listed as last-update-unknown meaning it could be a mirror problem. If karel's possible duplicate link doesn't help, I'd suggest moving from your country mirror to the main archive.ubuntu.com site.
    – guiverc
    Feb 28, 2019 at 10:36
  • @guiverc This shouldn’t be the main problem here since winehq-stable is not in the Ubuntu repositories. OP should switch to an up-to-date mirror though.
    – Melebius
    Feb 28, 2019 at 11:30
  • 1
    "270 packages can be upgraded" should be addressed before installing anything.
    – user535733
    Feb 28, 2019 at 13:03
  • Were you satisfied with my answer? Then please give me an upvote (▲). If I could solve your problem, it would be nice if you accepted my answer (✓). In the opposite case, please clarify your needs using editing or comments. See also askubuntu.com/help/someone-answers.
    – Melebius
    Mar 5, 2019 at 6:59

1 Answer 1

5

You seem to have skipped the apt-add-repository command. You only added the key of the WineHQ repository as trusted (apt-key add) but haven’t added the repository itself, so APT is still unable to find the package winehq-stable which resides in this repository. In the WineHQ guide, the relevant command is listed in a table and not formatted as code – which might be misleading.

According to your apt update output, your Ubuntu version is 18.04 (Bionic), so running this should be the right option for you1:

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

After this, you should be ready to run:

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

BUT it was installed:

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

Not yet… The lines

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

inform you about the progress in loading the package database. However, this procedure finished with an error (E:) in your case and the package has not been installed.


1 You could also use an universal version of the apt-add-repository command which fills in your release name automatically:

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

Not the answer you're looking for? Browse other questions tagged .