You are not logged in.
Pages: 1
Hello:
Is there a way to retrieve the /etc/apt/sources.list file from the command line?
Something like this:
# apt-get install sources.list <- just an idea, I know it does not work
Or do I have to jed and edit sources.list by hand?
Thanks in advance.
A.
Last edited by Altoid (2019-05-01 13:53:49)
Offline
# nano /etc/apt/sources.list
Or your text editor of choice. You can also edit with synaptic.
Online
As you know, the file /etc/apt/sources.list and all the files /etc/apt/sources.list.d/*.list together form a configuration for apt-get (or "the apt sub system"), so that it knows which repositories, and which sections in those it should access. Thus, you can't really install such a configuration without already having a configuration, which kind of makes this a circular thought.
But there are utilities that can produce different source.list files for different distribution flavours, and that might be useful initially. Use your favourite WWW search engine to find a good one if you like. Typically you make a few selections of what to include and what not, then, assuming your can trust it, you download the result and place into your sources.list.
However, I would say it is of highest importance security-wise that the machine administrator knows exactly what the "apt sub system" configuration is. There is no escape from putting enough cognitive effort into learning it. This also includes the "pinning" aspect, which is configured in the /etc/apt/preferences.d/* files, and the "general apt parameters" of /etc/apt/apt.conf and the /etc/apt/apt.conf.d/* files.
Unfortunately the apt sub system was devised at a time when the nuances of "trust" were less developed; the ease by which it can be changed, even by vendors as you install their distributed packages, is totally off parity with its importance.
Offline
Display is possible e.g. with:
grep -v '^#\|^$' /etc/apt/sources.list{,.d/*}
Rolf
Offline
Hello:
... can't really install such a configuration without already having a configuration ...
Indeed !!! LoL
Only after a good while did I realise how dumb my question was.
ie:
You have to know where the source is to know where the source is.
A chicken or egg? thing. 8-/
So when I got home I cp'd the sources.list file from my other desktop setup to /etc/apt and that was it.
... assuming your can trust it ...
Hmmm ...
For all my Devuan things I trust only Devuan sources.
Or ones that have been adequately verified by other derived distributions/groups.
... of highest importance security-wise that the machine administrator knows exactly what the "apt sub system" configuration is.
There is no escape from putting enough cognitive effort into learning it.
Quite so ...
For all my Linux experiences, I have (almost) always used synaptic, but with this installation on my trusty 1000HE, I have been rather enjoying the command line once again.
Reminds me of my long gone DOS days and hopefully I'll be able to pick up the pace soon enough.
... includes the "pinning" aspect, which is configured in the /etc/apt/preferences.d/* files, and the "general apt parameters" of /etc/apt/apt.conf and the /etc/apt/apt.conf.d/* files.
Right. Duly noted, thanks for the heads up.
Hopefully I'll one day be able to do anything on the command line in Linux. =-)
... devised at a time when the nuances of "trust" were less developed ...
... totally off parity with its importance.
Maybe that will change one day, if we all put enough behind that notion.
There's too much bad influence out there, convenience seems to have become the word.
Thanks for your input.
A.
Offline
Try
# apt edit-sources
That will open /etc/apt/sources.list in the editor of your choice and check the syntax before saving the file so you don't make any mistakes.
Brianna Ghey — Rest In Power
Offline
Hello:
Try ...
Neat ... =-D!
Thanks for the tip.
A.
Offline
Pages: 1