List errors after trying to install Wine via Terminal commands

I have a problem after trying to install Wine using a method posted by WineHQ, which caused corruption.

I tried running suggestions made elsewhere by @drpjkurian but still end with errors.

I'm using 21.04 via PosOS and KDE cosmic

Here is the terminal commands I used and the err messages that followed.

$ sudo rm -r /var/lib/apt/lists/

$ sudo mkdir -p /var/lib/apt/lists/partial

$ sudo apt-get update

E: Malformed entry 1 in list file /etc/apt/sources.list.d/archive_uri-https_dl_winehq_org_wine-builds_ubuntu_hirsute-hirsute.list (Component)

E: The list of sources could not be read.

As a result I can't run and GUI package managers like Discover or Muon.

The problem started when I tried following WineHQ's instructions for installing Wine via Terminal commands. Here is the original enteries:

$ sudo dpkg --add-architecture i386

[sudo] password for antonvs:

$ wget -nc https://dl.winehq.org/wine-builds/winehq.key --2021-07-11 01:16:03-- https://dl.winehq.org/wine-builds/winehq.key

Resolving dl.winehq.org (dl.winehq.org)... 151.101.82.217

Connecting to dl.winehq.org (dl.winehq.org)|151.101.82.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

2021-07-11 01:16:04 (16.4 MB/s) - ‘winehq.key’ saved [3220/3220]

$ sudo apt-key add winehq.key

Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). OK

$ sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/hirsute main' Repository: 'deb https://dl.winehq.org/wine-builds/ubuntu/hirsute main' Description: Archive for codename: main components: More info: https://dl.winehq.org/wine-builds/ubuntu/hirsute Adding repository. Press [ENTER] to continue or Ctrl-c to cancel.

Adding deb entry to /etc/apt/sources.list.d/archive_uri-https_dl_winehq_org_wine-builds_ubuntu_hirsute-hirsute.list Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-https_dl_winehq_org_wine-builds_ubuntu_hirsute-hirsute.list

E: Malformed entry 1 in list file /etc/apt/sources.list.d/archive_uri-https_dl_winehq_org_wine-builds_ubuntu_hirsute-hirsute.list (Component) E: The list of sources could not be read.

Here is the contents of /etc/apt (which shows duplicate sources.list files with a ~ added. Maybe this means duplicate or unsaved files.

antonvs@pop-os:/etc/apt$ ll total 60

  • drwxr-xr-x 7 root root 4096 Jul 11 01:16 ./
  • drwxr-xr-x 152 root root 12288 Jul 11 01:07 ../
  • drwxr-xr-x 2 root root 4096 Jul 3 19:54 apt.conf.d/
  • drwxr-xr-x 2 root root 4096 Apr 9 2020 auth.conf.d/
  • drwxr-xr-x 2 root root 4096 Jul 3 11:27 preferences.d/
  • -rw-r--r-- 1 root root 103 Jul 11 01:21 sources.list
  • -rw-r--r-- 1 root root 783 Jun 24 05:03 sources.list~
  • drwxr-xr-x 2 root root 4096 Jul 11 01:21 sources.list.d/
  • -rw-r--r-- 1 root root 875 Jul 3 10:24 sources.list.save
  • -rw-r--r-- 1 root root 5313 Jul 11 01:16 trusted.gpg
  • -rw-r--r-- 1 root root 2942 Jul 10 15:21 trusted.gpg~
  • drwxr-xr-x 2 root root 4096 Jul 11 01:16 trusted.gpg.d/

I have tried registering with WineHQ's forum but can't answer their anti-spam questions during registration. Because of this I'm trying my luck here.

Thanks in advance if anyone has a solution.


OK, after delving a bit deeper and learning that I need to use sudoedit to look at the file giving the error, I found that the command that I had copied from WineHQ had an error.

Line 1 was:

deb https://dl.winehq.org/wine-builds/ubuntu/hirsute main

and needed to be:

deb https://dl.winehq.org/wine-builds/ubuntu hirsute main
# deb-src https://dl.winehq.org/wine-builds/ubuntu/hirsute main

The last backslash was incorrect. Please mark as solved.