Announcement

Collapse
No announcement yet.

E: Malformed stanza 1 in source list /etc/apt/sources.list.d/ubuntu.sources

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    E: Malformed stanza 1 in source list /etc/apt/sources.list.d/ubuntu.sources

    apt-get update
    N: Ignoring file 'ubuntu.sources.backup' in directory '/etc/apt/sources.list.d/' as it has an invalid filename
    extension
    E: Malformed stanza 1 in source list /etc/apt/sources.list.d/ubuntu.sources (type)
    E: The list of sources could not be read.



    I don't know how I managed to tweek this wrong

    ​Here is the text of /etc/apt/sources.list.d/ubuntu.sources

    deb http: //archive.ubuntu.com/ubuntu noble-backports main universe restricted multiverse
    Enabled: no​


    # Automatically generated by Calamares on 2025-02-01.
    # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    # newer versions of Kubuntu.
    ## Ubuntu distribution repository
    ##
    ## The following settings can be adjusted to configure which packages to use from Ubuntu.
    ## Mirror your choices (except for URIs and Suites) in the security section below to
    ## ensure timely security updates.
    ##
    ## Types: Append deb-src to enable the fetching of source package.
    ## URIs: A URL to the repository (you may add multiple URLs)
    ## Suites: The following additional suites can be configured
    ## <name>-updates - Major bug fix updates produced after the final release of the
    ## distribution.
    ## <name>-backports - software from this repository may not have been tested as
    ## extensively as that contained in the main release, although it includes
    ## newer versions of some applications which may provide useful features.
    ## Also, please note that software in backports WILL NOT receive any review
    ## or updates from the Ubuntu security team.
    ## Components: Aside from main, the following components can be added to the list
    ## restricted - Software that may not be under a free license, or protected by patents.
    ## universe - Community maintained packages.
    ## Software from this repository is only maintained and supported by Canonical
    ## for machines with Ubuntu Pro subscriptions. Without Ubuntu Pro, the Ubuntu
    ## community provides best-effort security maintenance.
    ## multiverse - Community maintained of restricted. Software from this repository is
    ## ENTIRELY UNSUPPORTED by the Ubuntu team, and may not be under a free
    ## licence. Please satisfy yourself as to your rights to use the software.
    ## Also, please note that software in multiverse WILL NOT receive any
    ## review or updates from the Ubuntu security team.
    ##
    ## See the sources.list(5) manual page for further settings.
    Types: deb
    URIs: http://us.archive.ubuntu.com/ubuntu
    Suites: noble noble-updates noble-backports
    Components: main universe restricted multiverse
    Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

    ## Ubuntu security updates. Aside from URIs and Suites,
    ## this should mirror your choices in the previous section.
    Types: deb
    URIs: http://security.ubuntu.com/ubuntu/
    Suites: noble-security
    Components: main universe restricted multiverse
    Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

    Last edited by antarctictaco020125; Jul 21, 2025, 11:55 PM.

    #2
    It's not the ubuntu.sources file that causes the error. You also have an ubuntu.sources.backup file in /etc/apt/sources.list.d/ (possibly you created a backup yourself?)...and apt complains that the file has a wrong extension (.backup) as it looks for ".sources". You can delete the backup (or move it somewhere else if you want to keep it)

    EDIT: Ah sorry, misread...there is some error in the ubuntu.sources as well, I'll take another look

    EDIT2:
    Code:
    deb http: //archive.ubuntu.com/ubuntu noble-backports main universe restricted multiverse
    Enabled: no​​
    Is that also in your ubuntu.sources? You had two quotes so I'm not sure. That seems to be in the older .list format rather than the newer .sources format...probably throwing that error. Remove it to test if it fixes it.
    Last edited by kubicle; Yesterday, 12:09 AM.

    Comment


      #3

      Line one, the top line, does not belong and does not match the format for the rest of the file -- it is using the old format, which is OK, on its own, but not when mixed with the correct format in the remainder.

      Also this line is redundant.
      Why is "Enabled: no​" on line 2? This is a stock repo, and probably is not normal to disable it. Also, this line *might* disable the whole file, you do NOT want that.

      If you do not want this, then remove it from the 'suites' line

      For a backup file, either place it elsewhere, or rename it to ubuntu.sources.save, I think.

      Comment


        #4
        Originally posted by claydoh View Post
        Line one, the top line, does not belong and does not match the format for the rest of the file -- it is using the old format, which is OK, on its own, but not when mixed with the correct format in the remainder.

        Also this line is redundant.
        Why is "Enabled: no​" on line 2? This is a stock repo, and probably is not normal to disable it. Also, this line *might* disable the whole file, you do NOT want that.

        If you do not want this, then remove it from the 'suites' line

        For a backup file, either place it elsewhere, or rename it to ubuntu.sources.save, I think.
        Click image for larger version  Name:	image.png Views:	0 Size:	41.1 KB ID:	687733
        What I did was copy and paste to the back up, then tweaked the settings features in Discovery and the synaptic package manager. sudo apt-get update works!
        Last edited by antarctictaco020125; Yesterday, 01:07 AM.

        Comment

        Users Viewing This Topic

        Collapse

        There are 0 users viewing this topic.

        Working...
        X