LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Help in writing apt-get 'sources.list' (https://www.linuxquestions.org/questions/debian-26/help-in-writing-apt-get-sources-list-754622/)

unev_21 09-12-2009 08:05 AM

Help in writing apt-get 'sources.list'
 
Hi,

Im tring to understand how to write a sources.list file. I have the following questions-

1) Assume my sources.list has two sources A & B to pick the packages from. A has latest version for few packages & B has latest for remaining packages. How should I write my sources.list file

Regards,
unev

jdkaye 09-12-2009 08:35 AM

Quote:

Originally Posted by unev_21 (Post 3679923)
Hi,

Im tring to understand how to write a sources.list file. I have the following questions-

1) Assume my sources.list has two sources A & B to pick the packages from. A has latest version for few packages & B has latest for remaining packages. How should I write my sources.list file

Regards,
unev

In the very first thread of this forum (Debian) there zillions of examples of sources.list files. Just look at a few and you'll get the idea. The order in which you put the files is irrelevant since (in principle) no source should have the same packages in the same version (Lenny, Squeeze, Sid, Experimental, etc.) as any other. In most cases these sources come in pairs: the binary packages and the source (src) packages.

cheers,
jdk

j1alu 09-12-2009 09:06 AM

if you dont do some magic like pinning or editing conf-files the package-managing will pick the newest version. out of box.

-----
eg: this line in /etc/apt/apt.conf
Code:

APT::Default-Release "testing";
will set the default release to testing if you run a mixed testing/unstable system (to install from unstable you would need to do it like in the next example)


if you got a lenny-backports for lenny, or experimental-repo and sid,you need explicit tell apt* to install from there:
Code:

apt-get install -t lenny-backports package_name
apt-get install -t experimental package_name

u can run a simultated installation to check if it works out the way you want it:
Code:

apt-get install -s package_name
i for one am very happy with the official debian-repos (either lenny and lenny-backports or a pure debian-unstable repo. + e17 repos, but thats a different story.)

greetings

(replace apt-get with aptitude or synaptic or any tool you prefer).

unev_21 09-12-2009 10:37 AM

thanks guys...let me try out the examples jdkaye pointed out...

jdkaye 09-12-2009 11:12 PM

Quote:

Originally Posted by unev_21 (Post 3680097)
thanks guys...let me try out the examples jdkaye pointed out...

Just remember to use the sources.list appropriate to your installation. If you're using Lenny, then make sure that lenny or stable appear in each repo. I use testing (aka squeeze) so my repos look like this:
Code:

deb http://ftp.de.debian.org/debian/ testing main non-free contrib
Got it?
jdk

unev_21 09-13-2009 03:48 AM

Not exactly jdkaye....
You mentioned "deb http://ftp.de.debian.org/debian/ testing main non-free contrib" Here there is no reference to squeeze. How does apt-get know that it has to download packages for squeeze..

I just dont get the concept of how apt-get works...It will be great if some one can direct me to appropriate knowledge base...

the trooper 09-13-2009 04:28 AM

Quote:

Originally Posted by unev_21 (Post 3680750)
Not exactly jdkaye....
You mentioned "deb http://ftp.de.debian.org/debian/ testing main non-free contrib" Here there is no reference to squeeze. How does apt-get know that it has to download packages for squeeze..

I just dont get the concept of how apt-get works...It will be great if some one can direct me to appropriate knowledge base...

Squeeze is the current codename for the Testing distribution.
So you can use either squeeze or testing in your sources.list.
It makes no difference to apt at the moment.

unev_21 09-13-2009 04:52 AM

Thanks all.

I found a primer for apt-get. http://www.linux.com/archive/feature/113879
It answered all my queries....

culaterout 09-13-2009 08:54 AM

Quote:

Originally Posted by unev_21 (Post 3680782)
Thanks all.

I found a primer for apt-get. http://www.linux.com/archive/feature/113879
It answered all my queries....

Thank you for posting this!!!


Starting to understand what makes Debian so much better then Linux Mint or Ubuntu...

yes, I can see how I could setup Ubuntu for this, but its kinda spotty...

Not as much control as with Debian....

jdkaye 09-13-2009 11:50 PM

As you're just getting started, I would recommend that you use aptitude and not apt-get for your packages. If you wish to know why, just search LQ for aptitude apt-get and you'll find loads of threads discussing this point.
cheers,
jdk


All times are GMT -5. The time now is 08:32 AM.