0

Unfortunately (and quite stupidly), I had .txt files set to open with Libreoffice Writer by default, and when I clicked on my sources.list file to add something, it opened up there. I suspect this is likely the cause of my problem, as now I can't get my repos to update, or install any packages.

When I try to update the repos, I get the following error message:

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

Line 1 in sources.list reads:

deb cdrom:[elementary OS 5.1 hera - stable amd64 (20200814)]/ bionic contrib main non-free

Commenting out the first line doesn't help either. If I put a "#" before "deb" I get the following error message:

E: Malformed line 1 in source list /etc/apt/sources.list (type)

Given that I can't install any packages or update my repo until I fix this, what do I do?

0

Use the following command to fix your sources.list (copy and past):

cat <<EOF |sudo tee  /etc/apt/sources.list

deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ bionic partner
EOF

sudo apt update

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.