Corrupted apt-get file?

Yesterday I used apt to uninstall an app here (in Zorin 15). It was the first time I'd ever used it for an uninstall. Today I tried to install some different app with sudo apt-get install but no matter which app I choose it just gives me this error:-

E: Malformed line 1 in source list /etc/apt/sources.list (type)
E: The list of sources could not be read

sources.list was only about 800 bytes so I made a copy to see if I could view it in a text editor. I'm not sure what it should contain but there's nothing readable.

Is there some way to reset sources.list to whatever it should be?

Can you try with simply sudo apt install (drop the -get)?

Same 2 error lines unfortunately :unamused:

If it's not possible to reset the file somehow, is there anywhere where I could download it? It was for Zorin ver 15

Have you tried sudo apt-get update or sudo apt update??
If you have, was there any error from one of the repositories that was listed there??

Same errors as above I'm afraid...

Might it be worthwhile for me to delete sources.list and then see if an update will rebuild it?

Could you copy the outputs from that command to here, please??

Same ones that I mentioned above - i.e.

I'm so sorry if I couldn't be more helpful to you. But here what I did in the past where I faced an issue that were caused by the repositories. The outputs were these:

W: GPG error: http://download.opensuse.org/repositories/home:/ungoogled_chromium/Ubuntu_Focal  InRelease: The following signatures were invalid: EXPKEYSIG 02456C79B2FD48BF home:ungoogled_chromium OBS Project <home:ungoogled_chromium@build.opensuse.org>
E: The repository 'http://download.opensuse.org/repositories/home:/ungoogled_chromium/Ubuntu_Focal  InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Then I opened up Software & Updates,
image

Choose Other Software
image

Then scrolled down until I found http://download.opensuse.org/repositories/home:/ungoogled_chromium/Ubuntu_Focal InRelease: and unticked it, and then press Closeand proceed to Reload
image

image

After that, I tried sudo apt update again and everything is back to normal.

Now, it's important to note that I don't suggest you to do this if the terminal outputs doesn't specify which repository that caused a problem.

Since it's already broken you could go ahead and try to fix this manually, but whatever you do first of all make a copy of that file first:

# Any name will do, for example
sudo cp /etc/apt/sources.list /etc/apt/sources.old.list

My guess is that is probably missing some "main" at the end of one of the line or something. If you don't mind sharing the file we could take a look here. Otherwise you can try educating yourself with a video such as this one:

1 Like

Okay, but is there a way to upload it? The extension .list isn't accepted. As an experiment I tried changing the extension to .webp but that then told me the file couldn't be verified.

You can copy/paste the file here (or at leas the first few lines since that's where the error message is pointing to where the issue is). You can also use a 3rd party service like pastebin.

1 Like

Thanks swarfendor437. I'll take a look at that article later.

zenzen - there's currently no readable text in sources.list here. I'm pretty sure it's just 800 bytes of junk :disappointed:

[Edit...] I renamed sources.list here and then ran sudo apt update and sudo apt-get update which both now seem to work. Interestingly, it didn't recreate etc/apt/sources.list but it did create a new sources.list in rofs/etc/apt. The new version is a plain text file containing the following text:-

deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

Some progress at least, that's more like what is should look like. The article mentioned by @swarfendor437 looks like it could solve the issue altogether, give it a read specially the "Solution 6 - /etc/apt/sources.list is missing or corrupted" section, and see if that works.

1 Like

Incidentally... I've been using Zorin Live ver 15 up until now but if I wanted to try ver 16 from a bootable USB stick is that possible? I've read about something called Zorin 16 Lite - but is Lite the same as Live?

All of the Zorin OSs is/has live. The lite version uses XFCE instead of Gnome.

Thanks Storm - do you know where it can be downloaded? I've found downloads for Pro, Core and Lite but nothing for the Live version :disappointed:

If you use the officials channel (Piracy can get you banned & most of all you compromising your OS) - All of them have live version. You simple "burn" the image to the USB. Pop in the USB and bootup from it. When you're in live session you can choose to install it on your hard drive.

Thanks again Storm - I created a bootable USB stick using Zorin Core (ver 16) but unlike ver 15, ver 16 doesn't seem to handle persistence very well. Certain things do work - e.g. it'll remember my Region settings and screensaver settings etc. But if I install an app or even just copy files to the desktop, any changes of that kind will get totally forgotten, next time I boot the USB stick.

Has anyone else mentioned that?

How are you creating the bootable USB drive? The lack of persistence between reboots is the expected behavior when running a live image :thinking: