How to solve the error: WARNING:root:could not open file '/etc/apt/sources.list'PATH and sources.list issueInstalling anaconda3 on Ubuntu 16.04Not able to install from ubuntu software centerWhy can't I start onedrive-d?Problems with Ubuntu CenterTypeError when running update-manager on ubuntu 17.10Ubuntu 16.04 can't install any softwaresoftware-properties-gtk crashes on startup (19.10)

Finding the right insults

Portisch-Radulov, Moscow 1977. Doesn't 16.c5 lose a pawn?

An Ailing Assassin

Students using the same flawed online solution sheet as the grading TA

Use of Concentration for pH

Sudden cheap travel?

Why is 1>a.txt 2>&1 different from 1>a.txt 2>a.txt ? (Example shown)

Have spacecraft photographed each other beyond Earth orbit?

SQL Deadlocks - Same Stored Procedure Called Concurrently

What does "你舒服吗" mean in a relationship context?

Can you marry a girl in Stardew Valley if you are a girl?

What is the melting temperature of a 3D printed part?

Sleep for 1000 years

Is an Immune creature considered to have the condition without suffering its effects?

I shift the source code, you shift the input!

I’m 18 years old and want to finance a £30,000 car

Why don't the absolute value functions in C accept const inputs?

Does the production of a Tesla battery produce as much CO2 as driving 200,000 km?

Would a uranium 235 fuel pellet the size of Earth explode?

Should I replace fillable PDFs?

Should trigger handlers be static or non-static?

If a problem is in P solved via dynamic programming, is it also in NP?

Where does Elseworlds fit into Batwoman chronology?

Is it possible for a tiger's tail to be taken off and replaced with a living cobra, with both creatures still alive?



How to solve the error: WARNING:root:could not open file '/etc/apt/sources.list'


PATH and sources.list issueInstalling anaconda3 on Ubuntu 16.04Not able to install from ubuntu software centerWhy can't I start onedrive-d?Problems with Ubuntu CenterTypeError when running update-manager on ubuntu 17.10Ubuntu 16.04 can't install any softwaresoftware-properties-gtk crashes on startup (19.10)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









6


















wazir@wazir:~$ sudo software-properties-gtk
[sudo] password for wazir:

(process:15506): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Cannot set locale: unsupported locale setting
WARNING:root:could not open file '/etc/apt/sources.list'

WARNING:root:could not open file '/etc/apt/sources.list'

Traceback (most recent call last):
File "/usr/bin/software-properties-gtk", line 104, in <module>
app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
File "/usr/lib/python2.7/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 89, in __init__
SoftwareProperties.__init__(self, options=options, datadir=datadir)
File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 97, in __init__
self.reload_sourceslist()
File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 585, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 87, in get_sources
raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template









share|improve this question

































    6


















    wazir@wazir:~$ sudo software-properties-gtk
    [sudo] password for wazir:

    (process:15506): Gtk-WARNING **: Locale not supported by C library.
    Using the fallback 'C' locale.
    Cannot set locale: unsupported locale setting
    WARNING:root:could not open file '/etc/apt/sources.list'

    WARNING:root:could not open file '/etc/apt/sources.list'

    Traceback (most recent call last):
    File "/usr/bin/software-properties-gtk", line 104, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
    File "/usr/lib/python2.7/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 89, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir)
    File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 97, in __init__
    self.reload_sourceslist()
    File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 585, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
    File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 87, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
    aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template









    share|improve this question





























      6













      6









      6








      wazir@wazir:~$ sudo software-properties-gtk
      [sudo] password for wazir:

      (process:15506): Gtk-WARNING **: Locale not supported by C library.
      Using the fallback 'C' locale.
      Cannot set locale: unsupported locale setting
      WARNING:root:could not open file '/etc/apt/sources.list'

      WARNING:root:could not open file '/etc/apt/sources.list'

      Traceback (most recent call last):
      File "/usr/bin/software-properties-gtk", line 104, in <module>
      app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
      File "/usr/lib/python2.7/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 89, in __init__
      SoftwareProperties.__init__(self, options=options, datadir=datadir)
      File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 97, in __init__
      self.reload_sourceslist()
      File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 585, in reload_sourceslist
      self.distro.get_sources(self.sourceslist)
      File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 87, in get_sources
      raise NoDistroTemplateException("Error: could not find a "
      aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template









      share|improve this question
















      wazir@wazir:~$ sudo software-properties-gtk
      [sudo] password for wazir:

      (process:15506): Gtk-WARNING **: Locale not supported by C library.
      Using the fallback 'C' locale.
      Cannot set locale: unsupported locale setting
      WARNING:root:could not open file '/etc/apt/sources.list'

      WARNING:root:could not open file '/etc/apt/sources.list'

      Traceback (most recent call last):
      File "/usr/bin/software-properties-gtk", line 104, in <module>
      app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
      File "/usr/lib/python2.7/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 89, in __init__
      SoftwareProperties.__init__(self, options=options, datadir=datadir)
      File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 97, in __init__
      self.reload_sourceslist()
      File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 585, in reload_sourceslist
      self.distro.get_sources(self.sourceslist)
      File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 87, in get_sources
      raise NoDistroTemplateException("Error: could not find a "
      aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template






      apt software-center package-management






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 2 '14 at 14:30









      Rmano

      27.7k10 gold badges92 silver badges183 bronze badges




      27.7k10 gold badges92 silver badges183 bronze badges










      asked Sep 2 '14 at 13:25









      Abdelrahman WazirAbdelrahman Wazir

      731 gold badge2 silver badges5 bronze badges




      731 gold badge2 silver badges5 bronze badges























          4 Answers
          4






          active

          oldest

          votes


















          7



















          Changing the permissions might work:



          sudo chmod -R 0644 /etc/apt/sources.list.d/


          UPDATE: I previously set the mode to 0420, which worked in my case, but per comments and further testing it seems that 0644 is correct.






          share|improve this answer



























          • The proper permission would be 644 on those files.

            – Videonauth
            Jun 14 '16 at 0:22











          • Do you have a source for that? I tried 644 and it did not work. The files in that directory that were not throwing errors already had 0420 mode, so I applied that to the remaining files to get it to work.

            – peter
            Jun 14 '16 at 0:25











          • Indeed i have a source, a clean install on a VM where I just looked at the directory and each file has -rw-r--r--. 1 root root which is in fact 644. Beside that giving the owner only read rights prevents later changes on this file greatly and I'm not really sure why you think the group needs write access but the owner not this is what your given permissions imply is -r---w----. 1 root root and thats plain wrong. See as well help.ubuntu.com/community/FilePermissions

            – Videonauth
            Jun 14 '16 at 0:26












          • Directories should be executable or else you can't get listings of them. You want sudo find -type d /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0755 && sudo find -type f /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0644

            – Adam Katz
            Mar 14 at 20:11


















          3



















          The sources.list files are in /etc/apt/sources.list.d in newer version of Ubuntu. So you need to make a symbolic link from official-package-repositories.list to the old place to solve this problem:



          sudo ln -s /etc/apt/sources.list.d/official-package-repositories.list /etc/apt/sources.list





          share|improve this answer
































            3



















            1. You shouldn't use sudo to open graphical applications as root. You should install the gksu package from the Ubuntu Software Center and use the gksudo command instead of sudo to open a graphical application as root.


            2. You shouldn't run software-properties-gtk as root either. If you need to be root, the application will prompt you in a popup window to authenticate with your user password. Since software-properties-gtk has a built-in authentication feature, you don't need to run it except as a regular user.


            3. Try running software-properties-gtk properly, and see if you still get the same error.



            Ubuntu 18.04 and later



            gksu has been discontinued in Ubuntu 18.04 and later. To open software-properties-gtk as root run the following command:



            sudo -H software-properties-gtk &>/dev/null 





            share|improve this answer



























            • I learned something, but it did not solve my issue. Thank you anyway

              – Ted Taylor of Life
              Apr 17 '17 at 11:59











            • bash: /dev/nulll: Permission denied for ubuntu 18.04

              – Rocketq
              Sep 11 '18 at 18:00











            • @Rocketq Thank you for bringing this to my attention. This permission denied error was caused by a typo error (misspelled the word null) which I found and corrected.

              – karel
              Sep 11 '18 at 21:25












            • @karel /etc/apt/sources.list is neither an executable nor a directory. Why would you suggest adding execute permissions to it?

              – arielf
              Sep 30 at 19:10


















            0



















            I think execution permission is needed, try to run the following command:



            sudo chmod +x /etc/apt/sources.list.d





            share|improve this answer

























            • How is the directory /etc/apt/sources.list.d connected to the file /etc/apt/sources.list mentioned in the question?

              – Thomas
              Oct 11 at 12:18












            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );














            draft saved

            draft discarded
















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f519154%2fhow-to-solve-the-error-warningrootcould-not-open-file-etc-apt-sources-list%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown


























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            7



















            Changing the permissions might work:



            sudo chmod -R 0644 /etc/apt/sources.list.d/


            UPDATE: I previously set the mode to 0420, which worked in my case, but per comments and further testing it seems that 0644 is correct.






            share|improve this answer



























            • The proper permission would be 644 on those files.

              – Videonauth
              Jun 14 '16 at 0:22











            • Do you have a source for that? I tried 644 and it did not work. The files in that directory that were not throwing errors already had 0420 mode, so I applied that to the remaining files to get it to work.

              – peter
              Jun 14 '16 at 0:25











            • Indeed i have a source, a clean install on a VM where I just looked at the directory and each file has -rw-r--r--. 1 root root which is in fact 644. Beside that giving the owner only read rights prevents later changes on this file greatly and I'm not really sure why you think the group needs write access but the owner not this is what your given permissions imply is -r---w----. 1 root root and thats plain wrong. See as well help.ubuntu.com/community/FilePermissions

              – Videonauth
              Jun 14 '16 at 0:26












            • Directories should be executable or else you can't get listings of them. You want sudo find -type d /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0755 && sudo find -type f /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0644

              – Adam Katz
              Mar 14 at 20:11















            7



















            Changing the permissions might work:



            sudo chmod -R 0644 /etc/apt/sources.list.d/


            UPDATE: I previously set the mode to 0420, which worked in my case, but per comments and further testing it seems that 0644 is correct.






            share|improve this answer



























            • The proper permission would be 644 on those files.

              – Videonauth
              Jun 14 '16 at 0:22











            • Do you have a source for that? I tried 644 and it did not work. The files in that directory that were not throwing errors already had 0420 mode, so I applied that to the remaining files to get it to work.

              – peter
              Jun 14 '16 at 0:25











            • Indeed i have a source, a clean install on a VM where I just looked at the directory and each file has -rw-r--r--. 1 root root which is in fact 644. Beside that giving the owner only read rights prevents later changes on this file greatly and I'm not really sure why you think the group needs write access but the owner not this is what your given permissions imply is -r---w----. 1 root root and thats plain wrong. See as well help.ubuntu.com/community/FilePermissions

              – Videonauth
              Jun 14 '16 at 0:26












            • Directories should be executable or else you can't get listings of them. You want sudo find -type d /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0755 && sudo find -type f /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0644

              – Adam Katz
              Mar 14 at 20:11













            7















            7











            7









            Changing the permissions might work:



            sudo chmod -R 0644 /etc/apt/sources.list.d/


            UPDATE: I previously set the mode to 0420, which worked in my case, but per comments and further testing it seems that 0644 is correct.






            share|improve this answer
















            Changing the permissions might work:



            sudo chmod -R 0644 /etc/apt/sources.list.d/


            UPDATE: I previously set the mode to 0420, which worked in my case, but per comments and further testing it seems that 0644 is correct.







            share|improve this answer















            share|improve this answer




            share|improve this answer








            edited Jun 14 '16 at 0:40

























            answered Jun 13 '16 at 21:58









            peterpeter

            1791 silver badge5 bronze badges




            1791 silver badge5 bronze badges















            • The proper permission would be 644 on those files.

              – Videonauth
              Jun 14 '16 at 0:22











            • Do you have a source for that? I tried 644 and it did not work. The files in that directory that were not throwing errors already had 0420 mode, so I applied that to the remaining files to get it to work.

              – peter
              Jun 14 '16 at 0:25











            • Indeed i have a source, a clean install on a VM where I just looked at the directory and each file has -rw-r--r--. 1 root root which is in fact 644. Beside that giving the owner only read rights prevents later changes on this file greatly and I'm not really sure why you think the group needs write access but the owner not this is what your given permissions imply is -r---w----. 1 root root and thats plain wrong. See as well help.ubuntu.com/community/FilePermissions

              – Videonauth
              Jun 14 '16 at 0:26












            • Directories should be executable or else you can't get listings of them. You want sudo find -type d /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0755 && sudo find -type f /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0644

              – Adam Katz
              Mar 14 at 20:11

















            • The proper permission would be 644 on those files.

              – Videonauth
              Jun 14 '16 at 0:22











            • Do you have a source for that? I tried 644 and it did not work. The files in that directory that were not throwing errors already had 0420 mode, so I applied that to the remaining files to get it to work.

              – peter
              Jun 14 '16 at 0:25











            • Indeed i have a source, a clean install on a VM where I just looked at the directory and each file has -rw-r--r--. 1 root root which is in fact 644. Beside that giving the owner only read rights prevents later changes on this file greatly and I'm not really sure why you think the group needs write access but the owner not this is what your given permissions imply is -r---w----. 1 root root and thats plain wrong. See as well help.ubuntu.com/community/FilePermissions

              – Videonauth
              Jun 14 '16 at 0:26












            • Directories should be executable or else you can't get listings of them. You want sudo find -type d /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0755 && sudo find -type f /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0644

              – Adam Katz
              Mar 14 at 20:11
















            The proper permission would be 644 on those files.

            – Videonauth
            Jun 14 '16 at 0:22





            The proper permission would be 644 on those files.

            – Videonauth
            Jun 14 '16 at 0:22













            Do you have a source for that? I tried 644 and it did not work. The files in that directory that were not throwing errors already had 0420 mode, so I applied that to the remaining files to get it to work.

            – peter
            Jun 14 '16 at 0:25





            Do you have a source for that? I tried 644 and it did not work. The files in that directory that were not throwing errors already had 0420 mode, so I applied that to the remaining files to get it to work.

            – peter
            Jun 14 '16 at 0:25













            Indeed i have a source, a clean install on a VM where I just looked at the directory and each file has -rw-r--r--. 1 root root which is in fact 644. Beside that giving the owner only read rights prevents later changes on this file greatly and I'm not really sure why you think the group needs write access but the owner not this is what your given permissions imply is -r---w----. 1 root root and thats plain wrong. See as well help.ubuntu.com/community/FilePermissions

            – Videonauth
            Jun 14 '16 at 0:26






            Indeed i have a source, a clean install on a VM where I just looked at the directory and each file has -rw-r--r--. 1 root root which is in fact 644. Beside that giving the owner only read rights prevents later changes on this file greatly and I'm not really sure why you think the group needs write access but the owner not this is what your given permissions imply is -r---w----. 1 root root and thats plain wrong. See as well help.ubuntu.com/community/FilePermissions

            – Videonauth
            Jun 14 '16 at 0:26














            Directories should be executable or else you can't get listings of them. You want sudo find -type d /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0755 && sudo find -type f /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0644

            – Adam Katz
            Mar 14 at 20:11





            Directories should be executable or else you can't get listings of them. You want sudo find -type d /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0755 && sudo find -type f /etc/apt/sources.list.d -print0 |sudo xargs -0 chmod 0644

            – Adam Katz
            Mar 14 at 20:11













            3



















            The sources.list files are in /etc/apt/sources.list.d in newer version of Ubuntu. So you need to make a symbolic link from official-package-repositories.list to the old place to solve this problem:



            sudo ln -s /etc/apt/sources.list.d/official-package-repositories.list /etc/apt/sources.list





            share|improve this answer





























              3



















              The sources.list files are in /etc/apt/sources.list.d in newer version of Ubuntu. So you need to make a symbolic link from official-package-repositories.list to the old place to solve this problem:



              sudo ln -s /etc/apt/sources.list.d/official-package-repositories.list /etc/apt/sources.list





              share|improve this answer



























                3















                3











                3









                The sources.list files are in /etc/apt/sources.list.d in newer version of Ubuntu. So you need to make a symbolic link from official-package-repositories.list to the old place to solve this problem:



                sudo ln -s /etc/apt/sources.list.d/official-package-repositories.list /etc/apt/sources.list





                share|improve this answer














                The sources.list files are in /etc/apt/sources.list.d in newer version of Ubuntu. So you need to make a symbolic link from official-package-repositories.list to the old place to solve this problem:



                sudo ln -s /etc/apt/sources.list.d/official-package-repositories.list /etc/apt/sources.list






                share|improve this answer













                share|improve this answer




                share|improve this answer










                answered Feb 19 '15 at 12:44









                arppyarppy

                315 bronze badges




                315 bronze badges
























                    3



















                    1. You shouldn't use sudo to open graphical applications as root. You should install the gksu package from the Ubuntu Software Center and use the gksudo command instead of sudo to open a graphical application as root.


                    2. You shouldn't run software-properties-gtk as root either. If you need to be root, the application will prompt you in a popup window to authenticate with your user password. Since software-properties-gtk has a built-in authentication feature, you don't need to run it except as a regular user.


                    3. Try running software-properties-gtk properly, and see if you still get the same error.



                    Ubuntu 18.04 and later



                    gksu has been discontinued in Ubuntu 18.04 and later. To open software-properties-gtk as root run the following command:



                    sudo -H software-properties-gtk &>/dev/null 





                    share|improve this answer



























                    • I learned something, but it did not solve my issue. Thank you anyway

                      – Ted Taylor of Life
                      Apr 17 '17 at 11:59











                    • bash: /dev/nulll: Permission denied for ubuntu 18.04

                      – Rocketq
                      Sep 11 '18 at 18:00











                    • @Rocketq Thank you for bringing this to my attention. This permission denied error was caused by a typo error (misspelled the word null) which I found and corrected.

                      – karel
                      Sep 11 '18 at 21:25












                    • @karel /etc/apt/sources.list is neither an executable nor a directory. Why would you suggest adding execute permissions to it?

                      – arielf
                      Sep 30 at 19:10















                    3



















                    1. You shouldn't use sudo to open graphical applications as root. You should install the gksu package from the Ubuntu Software Center and use the gksudo command instead of sudo to open a graphical application as root.


                    2. You shouldn't run software-properties-gtk as root either. If you need to be root, the application will prompt you in a popup window to authenticate with your user password. Since software-properties-gtk has a built-in authentication feature, you don't need to run it except as a regular user.


                    3. Try running software-properties-gtk properly, and see if you still get the same error.



                    Ubuntu 18.04 and later



                    gksu has been discontinued in Ubuntu 18.04 and later. To open software-properties-gtk as root run the following command:



                    sudo -H software-properties-gtk &>/dev/null 





                    share|improve this answer



























                    • I learned something, but it did not solve my issue. Thank you anyway

                      – Ted Taylor of Life
                      Apr 17 '17 at 11:59











                    • bash: /dev/nulll: Permission denied for ubuntu 18.04

                      – Rocketq
                      Sep 11 '18 at 18:00











                    • @Rocketq Thank you for bringing this to my attention. This permission denied error was caused by a typo error (misspelled the word null) which I found and corrected.

                      – karel
                      Sep 11 '18 at 21:25












                    • @karel /etc/apt/sources.list is neither an executable nor a directory. Why would you suggest adding execute permissions to it?

                      – arielf
                      Sep 30 at 19:10













                    3















                    3











                    3









                    1. You shouldn't use sudo to open graphical applications as root. You should install the gksu package from the Ubuntu Software Center and use the gksudo command instead of sudo to open a graphical application as root.


                    2. You shouldn't run software-properties-gtk as root either. If you need to be root, the application will prompt you in a popup window to authenticate with your user password. Since software-properties-gtk has a built-in authentication feature, you don't need to run it except as a regular user.


                    3. Try running software-properties-gtk properly, and see if you still get the same error.



                    Ubuntu 18.04 and later



                    gksu has been discontinued in Ubuntu 18.04 and later. To open software-properties-gtk as root run the following command:



                    sudo -H software-properties-gtk &>/dev/null 





                    share|improve this answer
















                    1. You shouldn't use sudo to open graphical applications as root. You should install the gksu package from the Ubuntu Software Center and use the gksudo command instead of sudo to open a graphical application as root.


                    2. You shouldn't run software-properties-gtk as root either. If you need to be root, the application will prompt you in a popup window to authenticate with your user password. Since software-properties-gtk has a built-in authentication feature, you don't need to run it except as a regular user.


                    3. Try running software-properties-gtk properly, and see if you still get the same error.



                    Ubuntu 18.04 and later



                    gksu has been discontinued in Ubuntu 18.04 and later. To open software-properties-gtk as root run the following command:



                    sudo -H software-properties-gtk &>/dev/null 






                    share|improve this answer















                    share|improve this answer




                    share|improve this answer








                    edited Sep 30 at 22:35

























                    answered Sep 2 '14 at 13:51









                    karelkarel

                    71.8k15 gold badges160 silver badges187 bronze badges




                    71.8k15 gold badges160 silver badges187 bronze badges















                    • I learned something, but it did not solve my issue. Thank you anyway

                      – Ted Taylor of Life
                      Apr 17 '17 at 11:59











                    • bash: /dev/nulll: Permission denied for ubuntu 18.04

                      – Rocketq
                      Sep 11 '18 at 18:00











                    • @Rocketq Thank you for bringing this to my attention. This permission denied error was caused by a typo error (misspelled the word null) which I found and corrected.

                      – karel
                      Sep 11 '18 at 21:25












                    • @karel /etc/apt/sources.list is neither an executable nor a directory. Why would you suggest adding execute permissions to it?

                      – arielf
                      Sep 30 at 19:10

















                    • I learned something, but it did not solve my issue. Thank you anyway

                      – Ted Taylor of Life
                      Apr 17 '17 at 11:59











                    • bash: /dev/nulll: Permission denied for ubuntu 18.04

                      – Rocketq
                      Sep 11 '18 at 18:00











                    • @Rocketq Thank you for bringing this to my attention. This permission denied error was caused by a typo error (misspelled the word null) which I found and corrected.

                      – karel
                      Sep 11 '18 at 21:25












                    • @karel /etc/apt/sources.list is neither an executable nor a directory. Why would you suggest adding execute permissions to it?

                      – arielf
                      Sep 30 at 19:10
















                    I learned something, but it did not solve my issue. Thank you anyway

                    – Ted Taylor of Life
                    Apr 17 '17 at 11:59





                    I learned something, but it did not solve my issue. Thank you anyway

                    – Ted Taylor of Life
                    Apr 17 '17 at 11:59













                    bash: /dev/nulll: Permission denied for ubuntu 18.04

                    – Rocketq
                    Sep 11 '18 at 18:00





                    bash: /dev/nulll: Permission denied for ubuntu 18.04

                    – Rocketq
                    Sep 11 '18 at 18:00













                    @Rocketq Thank you for bringing this to my attention. This permission denied error was caused by a typo error (misspelled the word null) which I found and corrected.

                    – karel
                    Sep 11 '18 at 21:25






                    @Rocketq Thank you for bringing this to my attention. This permission denied error was caused by a typo error (misspelled the word null) which I found and corrected.

                    – karel
                    Sep 11 '18 at 21:25














                    @karel /etc/apt/sources.list is neither an executable nor a directory. Why would you suggest adding execute permissions to it?

                    – arielf
                    Sep 30 at 19:10





                    @karel /etc/apt/sources.list is neither an executable nor a directory. Why would you suggest adding execute permissions to it?

                    – arielf
                    Sep 30 at 19:10











                    0



















                    I think execution permission is needed, try to run the following command:



                    sudo chmod +x /etc/apt/sources.list.d





                    share|improve this answer

























                    • How is the directory /etc/apt/sources.list.d connected to the file /etc/apt/sources.list mentioned in the question?

                      – Thomas
                      Oct 11 at 12:18















                    0



















                    I think execution permission is needed, try to run the following command:



                    sudo chmod +x /etc/apt/sources.list.d





                    share|improve this answer

























                    • How is the directory /etc/apt/sources.list.d connected to the file /etc/apt/sources.list mentioned in the question?

                      – Thomas
                      Oct 11 at 12:18













                    0















                    0











                    0









                    I think execution permission is needed, try to run the following command:



                    sudo chmod +x /etc/apt/sources.list.d





                    share|improve this answer














                    I think execution permission is needed, try to run the following command:



                    sudo chmod +x /etc/apt/sources.list.d






                    share|improve this answer













                    share|improve this answer




                    share|improve this answer










                    answered Oct 11 at 11:55









                    harshharsh

                    1




                    1















                    • How is the directory /etc/apt/sources.list.d connected to the file /etc/apt/sources.list mentioned in the question?

                      – Thomas
                      Oct 11 at 12:18

















                    • How is the directory /etc/apt/sources.list.d connected to the file /etc/apt/sources.list mentioned in the question?

                      – Thomas
                      Oct 11 at 12:18
















                    How is the directory /etc/apt/sources.list.d connected to the file /etc/apt/sources.list mentioned in the question?

                    – Thomas
                    Oct 11 at 12:18





                    How is the directory /etc/apt/sources.list.d connected to the file /etc/apt/sources.list mentioned in the question?

                    – Thomas
                    Oct 11 at 12:18


















                    draft saved

                    draft discarded















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f519154%2fhow-to-solve-the-error-warningrootcould-not-open-file-etc-apt-sources-list%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown









                    Popular posts from this blog

                    Tamil (spriik) Luke uk diar | Nawigatjuun

                    Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                    Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?