Unable to resolve host address with wget

I was trying to install wine on a Debian 12 template, but after

sudo apt install wine

, I was getting an error saying that wine32 could not be found when running

wine

. So, after

sudo apt remove wine

https://wiki.winehq.org/ Debian I tried to install it following these steps, but with wget

sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/ wine-builds/winehq.key

When I run this command, it says it cannot resolve the name.

If I use the http://127.0.0.1:8082 proxy, I get a 403 and then an error message saying that the name could not be resolved.I think it would be easier after that if I could wget, but is there any solution?

Did you try this?

If you tried this and couldn’t resolve https://dl.winehq.org/ then can you resolve any other domains?

1 Like

I always had troubles using wget with Qubes. So, I’m using curl. Install it if you aready don’t have it installed.

Now, I’m not using wine (why would I since Windows HVM now works great under Qubes?), but just tested this for you, under debian-11-minimal:

$ sudo curl --proxy localhost:8082 /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key > winehq.key
$ gpg --import winehq.key

gpg: directory '/home/user/.gnupg' created
gpg: keybox '/home/user/.gnupg/pubring.kbx' created
gpg: key 76F1A20FF987672F: 1 signature not checked due to a missing key
gpg: /home/user/.gnupg/trustdb.gpg: trustdb created
gpg: key 76F1A20FF987672F: public key "WineHQ packages <wine-devel@winehq.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: no ultimately trusted keys found


This is the answer to your topic’s subject.

From there, you can install wine.

Be aware that prior to all of this, if your system is 64 bit, you’d need to enable 32 bit architecture (if you haven’t already):

sudo dpkg --add-architecture i386

EDIT: don’t forget to add repository to /etc/apt/sources.list and to run apt update after this. I’m adding it manually, usually:

sudo nano /etc/apt/sources.list

Now add the package repository line to the file and save it:

deb https://dl.winehq.org/wine-builds/debian bookworm main

Finally run apt update and install winehq-staging, I’d suggest.

1 Like

Thanks. I was able to get and import winehq.key by typing the command.

$ sudo curl --proxy localhost:8082 /etc/apt/keyrings/winehq-archive.keyhttps://dl.winehq.org/wine-builds/winehq.key> winehq.key $ gpg – import winehq.key

sudo dpkg --add-architecture i386

I also ran this and added the sources.list manually, but when I do an apt-update, it seems that the repository is not signed and cannot be updated. The following signature could not be verified because the public key is not available. The following signature could not be verified because the public key is not available.

Do I need to change multiple configuration items? If it is easy to import repositories etc. with wget without using curl, simply by loading the script into a template, I would like to try it.

For the time being, what seems to be easy to do? One method is

https://forum.qubes-os.org/t/curl-proxy-wget-proxy-scripts-in-templates-so-users-can-add-gpg-distro-keys-linked-to-added- external-repositories/10935/39

I tried running this in a template, but the name resolution error message did not change.

I have also tried a workaround using curl, but this time I cannot verify the public key and cannot proceed. For me, even if I have to use curl, it is OK if I can get it right, and if I can also authenticate the public key, the existing system is OK enough. I don’t want to risk having to re-install the system if I don’t want to change the settings.

What wget command did you try exactly?
Is this not working for you?

sudo https_proxy=http://127.0.0.1:8082/ http_proxy=http://127.0.0.1:8082/ wget --secure-protocol=TLSv1_2 --timeout=180 -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
1 Like

Yes, the newly presented command is still able to retrieve winehq.key. However, when sudo apt update, the repository is not signed, and updates cannot be safely performed from such a repository, and updates are disabled by default.

If the public key of the repository in winehq.key were available, I would be able to check the signature and apt update would be successfully defeated…

It works for me on Qubes OS 4.2 with debian-12-xfce template.
When I run these commands:

sudo dpkg --add-architecture i386 
sudo https_proxy=http://127.0.0.1:8082/ http_proxy=http://127.0.0.1:8082/ wget --secure-protocol=TLSv1_2 --timeout=180 -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo https_proxy=http://127.0.0.1:8082/ http_proxy=http://127.0.0.1:8082/ wget --secure-protocol=TLSv1_2 --timeout=180 -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
sudo apt update

I don’t get any errors.

1 Like

As I said, no errors for curl too.

1 Like

I was copy-pasting the same command as apparaus and was able to successfully get to apt update. The command I was typing was,

sudo dpkg --add-architecture i386
sudo curl --proxy localhost:8082 /etc/apt/keyrings/winehq-archive.key Index of /wine-builds winehq.key > winehq.key
gpg --import winehq.key
sudo curl --proxy localhost:8082 -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine- builds/debian/dists/bookworm/winehq-bookworm.sources
(or add manually to sources.list.d)
sudo apt update

I did that. I don’t know what was good and what was wrong, but from now on I will

sudo https_proxy=http://127.0.0.1:8082/ http_proxy=http://127.0.0.1:8082/ wget --secure-protocol=TLSv 1_2 --timeout=180

I will use this command. I think it is better to get it in a way that does not use curl as much as possible and that wget can be used.

Yes, I was able to install wine with the same command without any errors. From now on,

sudo https_proxy=http://127.0.0.1:8082/ http_proxy=http://127.0.0.1:8082/

I will try to wget after adding this first.

For curl it should’ve been:

sudo curl --proxy localhost:8082 -RO --output-dir /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
1 Like

Great to hear you made it, especially both ways. Please pick one post and choose it as a solution so it could help future users too. This is question very, very often asked. I’d leave this topic as is then, to be short. If issues arise in further stages, I’d open separate topics for them. People tend to find answers ASAP while reading ALAP, haha.

2 Likes