Read-only file system: '/etc/apt/sources.list'


#1

In trying to update/add some packages to my cloud9 but adding to the ‘/etc/apt/sources.list’ makes a read only error. Tried solution shown in this thread to create/add sources list URL but get READ ONLY error…


#2

The thread you mention tells you to use the directory /etc/apt/sources.list.d/. Create a file with a meaningful name of your repository in that directory and use the extension .list. In this file add your URL of the repo like you would in /etc/apt/sources.list


#3

Yes exactly what I tried doing but OS wouldn’t’ let me WRITE to the directory. READ only.


#4

Try this in a terminal sudo nano /etc/apt/sources.list.d/mysource.list

Fill file with what it needs then save and exit.


#5

What’s happening is that a sudo add-apt-repository… at terminal results the READ ONLY error

OSError: [Errno 30] Read-only file system: '/etc/apt/sources.list'

The python script is trying to write to the file…

I even tried chmod but it is the file system that’s reaad only

$ sudo chmod 644 /etc/apt/sources.list
chmod: changing permissions of ‘/etc/apt/sources.list’: Read-only file system

#6

Can you try the last suggestion from @jms1989 please? Thanks!


#7

Look exactly:
/etc/apt/sources.list
/etc/apt/sources.list.d/repro.list

You have to create your own file in the directory ending in .d


#8

Agreed… I did exactly that creating and saving that file with the deb repository url…
But the next step is to install the app in that repository results in this error

$sudo apt-get update
.....
W: GPG error: http://ppa.launchpad.net trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A1715D88E1DF1F24

 $ sudo apt-get install <package_name>                                                                              
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate <package_name>

of course <package_name> is replaced with actual name of package.

So either the repository was correctly read but missing GPG is the problem

or the repository update is the problem ??


#9

You’ll need to install the gpg key from that particular repository before you can use it.


#10

Yes it looks that way
this Ubuntu thread explains it in detail