LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-22-2020, 03:05 PM   #1
MKO10
LQ Newbie
 
Registered: Apr 2020
Posts: 1

Rep: Reputation: Disabled
Failed to get updates for refresh: E: Malformed line 1 in source list /etc/apt/sources.list (type)


First, I'd like to start off saying I have 0 experience with Linux and I apologize in advance for my ignorance. I'm figuring this out as I go along which seemed like the best way to learn.

My first problem was that my access to the sources list was denied. Checked a few threads online and opened it with:
sudo gedit /etc/apt/sources.list

The first few lines read as follows:
# deb cdrom:[Ubuntu 16.04.3 LTS_Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

What do I do to fix this?
 
Old 04-23-2020, 12:04 PM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Could it be that you accidentally turned on text wrapping in gedit?
https://i.stack.imgur.com/ed7DF.png
 
Old 04-23-2020, 11:42 PM   #3
Pentium4User
Member
 
Registered: Jan 2018
Posts: 81

Rep: Reputation: Disabled
Please show the full output of
Code:
cat /etc/apt/sources.list

Additionally, in the post you made, bionic-security is missing, but really important.
 
Old 04-24-2020, 05:49 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
E: Malformed line 1 in source list /etc/apt/sources.list (type)
I guess line 1 is the first line that does not start with a "#".
Code:
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
It does not look malformed to me, but the server can't be reached.
The hint "type" seems to point to the first word on the line (deb).
Maybe there's some invisible characters there? Maybe you edited the file on a Windows machine (that uses incompatible line endings)?

Please make an effort to use the command line for this one & show us commands exactly as entered & their full output, in CODE tags.
 
Old 04-24-2020, 06:54 AM   #5
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
You also may try creating a new working /etc/apt/sources.list from scratch with Ubuntu Sources List Generator. The site is pretty old, but fortunately, it supports bionic.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
E: Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/mono-official.list 221B Linux - Newbie 6 09-07-2017 12:14 PM
E:Malformed line 64 in source list /etc/apt/sources.list (URI parse) Help Please PacerguyDon Linux - Software 2 11-14-2012 11:49 AM
E: Malformed line 55 in source list /etc/apt/source.list (dist). Help! biipjames Linux - Newbie 2 12-07-2011 04:52 PM
'E:Malformed line 54 in source list /etc/apt/sources.list (dist parse), E:The list of vsssuccess@gmail.com Linux - Desktop 1 11-17-2010 08:17 AM
apt-get; E: Type 'GPG' is not known on line 20 in source list /etc/apt/sources.list tomorrow Linux - Newbie 9 05-21-2009 08:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 05:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration