Malformed entry in apt sources on WSL v2 Ubuntu 22.04

shashi nagthan 0 Reputation points
2025-02-17T10:23:33.0766667+00:00

Hello,
I am using ubuntu 22.04 through WSL (Windows subsystem for linux) v2 on Windows 11. I am trying to check if an LLM application in ubuntu through WSL can use the Intel Integrated GPU of my laptop. One of the steps involves installing Intel GPU drivers in WSL (ubuntu). For that i need to add microsoft packages server info into apt sources list and then run apt update. The apt update gives a error.

"cat /etc/apt/sources.list.d/microsoft.list" output is below

deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/ubuntu/22.04/prod/

the gpg file also exists:
ubuntu@LAPTOP-57HGBVT1:/tmp$ ll /usr/share/keyrings/microsoft.gpg

-rw-r--r-- 1 root root 641 Feb 17 14:44 /usr/share/keyrings/microsoft.gpg

Then i run "sudo apt-get update". I get error message :
E: Malformed entry 1 in list file /etc/apt/sources.list.d/microsoft.list (Suite)

E: The list of sources could not be read.

How can i get this thing to work?
Greatly appreciate your help.
Thanks,

Shashi.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,040 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anusree Nashetty 4,630 Reputation points Microsoft External Staff Moderator
    2025-02-18T05:31:53.6233333+00:00

    Hi shashi nagthan,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    The error you're encountering, E: Malformed entry 1 in list file /etc/apt/sources.list.d/microsoft.list (Suite), indicates that there is an issue with the format of the entry in your microsoft.list file.

    Open the file sudo nano /etc/apt/sources.list.d/microsoft.list and edit it.
    See that the line looks like this deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/ubuntu/22.04/prod jammy main
    After correcting the file, run the update command again.

    For your reference please check: sudo apt update: Malformed entry 1 in list file /etc/apt/sources.list.d/pgdg.list
    I'm getting errors about malformed entries

    If you have any further queries, please do let us know. If the answer is helpful, please click "Accept Answer" and "Upvote it"

    User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.