The officially official Devuan Forum!

You are not logged in.

#1 2019-04-27 22:49:16

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

[Solved] apt sources list retrieve?

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

#2 2019-04-28 00:25:42

golinux
Administrator
Registered: 2016-11-25
Posts: 3,137  

Re: [Solved] apt sources list retrieve?

# nano /etc/apt/sources.list

Or your text editor of choice.  You can also edit with synaptic.

Offline

#3 2019-04-28 00:43:46

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: [Solved] apt sources list retrieve?

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

#4 2019-04-28 06:12:43

rolfie
Member
Registered: 2017-11-25
Posts: 1,045  

Re: [Solved] apt sources list retrieve?

Display is possible e.g. with:

grep -v '^#\|^$' /etc/apt/sources.list{,.d/*}

Rolf

Offline

#5 2019-04-28 17:47:48

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

Re: [Solved] apt sources list retrieve?

Hello:

ralph.ronnquist wrote:

... 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.   

ralph.ronnquist wrote:

... 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.

ralph.ronnquist wrote:

... 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.

ralph.ronnquist wrote:

... 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.  =-)

ralph.ronnquist wrote:

... 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

#6 2019-04-29 19:22:31

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [Solved] apt sources list retrieve?

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

#7 2019-04-29 19:33:03

Altoid
Member
Registered: 2017-05-07
Posts: 1,415  

Re: [Solved] apt sources list retrieve?

Hello:

Head_on_a_Stick wrote:

Try ...

Neat ...   =-D!

Thanks for the tip.

A.

Offline

Board footer