I have lost the ability to use sudo

Asked by Tom Tosh

When I try to run any sudo command, I get this message.

E: Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/jellyfin.list
E: The list of sources could not be read.

Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Jeremy (wa113y3s) said :
#1

What does this show in terminal

cat /etc/apt/sources.list.d/jellyfin.list

Revision history for this message
Tom Tosh (ttosh) said :
#2

This is what it shows.

sudo apt update
sudo exit

On 6/13/23 5:55 PM, Jeremy wrote:
> Your question #706967 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/706967
>
> Jeremy posted a new comment:
> What does this show in terminal
>
> cat /etc/apt/sources.list.d/jellyfin.list
>

Revision history for this message
Tom Tosh (ttosh) said :
#3

It still shows:

sudo apt update
sudo exit

On 6/13/23 5:55 PM, Jeremy wrote:
> Your question #706967 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/706967
>
> Jeremy posted a new comment:
> What does this show in terminal
>
> cat /etc/apt/sources.list.d/jellyfin.list
>

Revision history for this message
Tom Tosh (ttosh) said :
#4

Still shows

sudo apt update
sudo exit

On 6/13/23 6:45 PM, Tom Tosh wrote:
> Your question #706967 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/706967
>
> You gave more information on the question:
> This is what it shows.
>
> sudo apt update
> sudo exit
>
>
> On 6/13/23 5:55 PM, Jeremy wrote:
>> Your question #706967 on Ubuntu changed:
>> https://answers.launchpad.net/ubuntu/+question/706967
>>
>> Jeremy posted a new comment:
>> What does this show in terminal
>>
>> cat /etc/apt/sources.list.d/jellyfin.list
>>

Revision history for this message
Tom Tosh (ttosh) said :
#5

I do not understand your question?

On 6/13/23 6:55 PM, Tom Tosh wrote:
> Your question #706967 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/706967
>
> You gave more information on the question:
> Still shows
>
> sudo apt update
> sudo exit
>
> On 6/13/23 6:45 PM, Tom Tosh wrote:
>> Your question #706967 on Ubuntu changed:
>> https://answers.launchpad.net/ubuntu/+question/706967
>>
>> You gave more information on the question:
>> This is what it shows.
>>
>> sudo apt update
>> sudo exit
>>
>>
>> On 6/13/23 5:55 PM, Jeremy wrote:
>>> Your question #706967 on Ubuntu changed:
>>> https://answers.launchpad.net/ubuntu/+question/706967
>>>
>>> Jeremy posted a new comment:
>>> What does this show in terminal
>>>
>>> cat /etc/apt/sources.list.d/jellyfin.list
>>>

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

For diagnostic purposes, what output do you receive for the following commands (to be executed in a terminal window):

uname -a
lsb_release -crid
sudo id

Based on the output we will then be able to give instructions for solving.

Revision history for this message
Tom Tosh (ttosh) said :
#7

tom@tom-OptiPlex-755:~$ uname -a
Linux tom-OptiPlex-755 5.15.0-73-generic #80~20.04.1-Ubuntu SMP Wed May 17 14:58:14 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

tom@tom-OptiPlex-755:~$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal

tom@tom-OptiPlex-755:~$ sudo id
[sudo] password for tom:
uid=0(root) gid=0(root) groups=0(root)
tom@tom-OptiPlex-755:~$

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#8

Ok. Apparently your problem is not that you cannot use sudo at all (the command "sudo id" is correctly working), but you cannot initiate package updates (sudo apt update), because there is wrong contents in one of the configuration files for the package management system.

Open a terminal window and issue the command

sudo rm /etc/apt/sources.list.d/jellyfin.list

and then verify whether package management commands work again with the command

sudo apt update

Do you still see errors or does this work again?

If you later want to install jellyfin software, you probably have to set up the jellyfin repositories. I assume that you should follow
https://jellyfin.org/docs/general/installation/linux#ubuntu

Revision history for this message
Tom Tosh (ttosh) said :
#9

Yes, This solved the problem.
I appreciate your help.
Tom