klricks wrote: ↑
Thu Dec 19, 2019 4:42 pm
As mentioned you have to use sudo when editing a file that is not in the users /home directory.
Note it is not recommended to make changes to the sources list. Doing so is one of the fasted ways to trash your OS into an unusable state.
Pedantically, you need to use sudo when attempting to to perform actions that your current user does not have access rights (permissions) to do so. This is complicated by permissions on directory and sticky bits, but you certainly will have read/write access to places other than your home directory. However, a large flag should go up when you do not have access to a file as a regular user. Should you be changing this file? Do you understand the the impact? Could you achieve the same result by adding the appropriate configuration file in your account rather than changing the system level one?
The second point should be in giant glowing letters. If you do not fully understand the ramifications of doing so, do not muck about with the sources list. You can end up installing apps from a different repo than the standard one or totally mucking up dependencies. If you absolutely need to install an apt from another repository, add it, install the app, then comment out the repo. If you stick to the standard RPT provided repositories you get software that will work on the Pi and that has been tested to play nicely with all the standard OS programs. Software from elsewhere may work without issue, it should work if it has been complied for ARMH, especially if it is Debian based, but it may not. If you have a good grasp of how Linux works it is not a big deal. If you are just starting out you may create tricky issues that are hard to debug and fix.