SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-03-08 08:06:43

hardran3
#! Junkie
From: forest town, lake land
Registered: 2011-02-26
Posts: 360

Apt Pinning and You: Living on the Edge with #!

This how to is getting old. I will be updating it soon. I expect to be finished by the end of September.


#! is based on Debian, a great GNU+Linux distribution. It has stable, secure, well tested, old packages. But sometimes you want or need something newer. That is where the testing, unstable, and experimental sources come in. Read on to learn how.

Warnings, etc.

Stop reading this now. You may break things. Seriously, stop reading. This could really mess up your system stability and security. Testing, unstable, and experimental don't get security updates. They also contain packages that have had far less testing and may break things horribly. Don't say I didn't warn you. Make sure to make a backup of any file you edit, so you can easily roll back any changes. I usually save all my backups with a common extension, my initials, like so:

cp fileiambacking.up fileiambacking.up.rcl

To find all of the files i have edited I can simply locate .rcl.




Setup

First you will need to edit /etc/apt/sources.list. Here is mine, use it as an example to add the testing, unstable, and experimental repositories to your own. You can find a list of Debian mirrors here.

## CRUNCHBANG
# Compatible with Debian Squeeze, but use at your own risk.
deb http://packages.crunchbanglinux.org/statler statler main

## DEBIAN
#STABLE
deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb http://ftp.us.debian.org/debian squeeze-updates main contrib non-free
#TESTING
deb http://ftp.us.debian.org/debian/ testing main contrib non-free
#UNSTABLE
deb http://ftp.us.debian.org/debian/ unstable main contrib non-free
#EXPERIMENTAL
deb http://ftp.us.debian.org/debian/ experimental main contrib non-free

## DEBIAN SECURITY
#STABLE
deb http://security.debian.org/ squeeze/updates main contrib non-free
#TESTING
deb http://security.debian.org/ wheezy/updates main contrib non-free

## DEBIAN BACKPORTS
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free

Now we need to make sure these new sources do not update every package on our system. Open /etc/apt/preferences and replace its contents with the following.

Package: *
Pin: release a=testing
Pin-Priority: 400

Package: *
Pin: release a=unstable
Pin-Priority: 300

Now you can sudo apt-get update. To check if things are working open a terminal and run the following:

apt-cache policy chromium-browser

It should return something like this:

brick@brack:~$ apt-cache policy chromium-browser
chromium-browser:
  Installed: (none)
  Candidate: 9.0.597.45~r70550-1
  Version table:
     10.0.648.205~r81283-1 0
        300 http://ftp.ca.debian.org/debian/ unstable/main i386 Packages
     9.0.597.45~r70550-1 0
        990 http://packages.crunchbanglinux.org/statler/ statler/main i386 Packages
     6.0.472.63~r59945-5+squeeze4 0
        500 http://ftp.ca.debian.org/debian/ squeeze/main i386 Packages
        400 http://ftp.ca.debian.org/debian/ testing/main i386 Packages
        500 http://security.debian.org/ squeeze/updates/main i386 Packages

The statler version of chromium-browser should have the highest priority, as it has in my example. If it looks good do a sudo apt-get update && sudo apt-get upgrade. If apt wants to replace half your system, don't do it. Leave a comment here, and roll back your changes for now. If not, you can start using the new sources.




Usage

To check what versions of a package are available:

apt-cache policy $package_name

This will give you a list of all versions of $package_name and what repositories they are in.


There are two ways to install from the testing, unstable, and experimental sources.

sudo apt-get install $package_name/unstable

This will install $package_name from unstable, but pull any dependencies from stable. If it is unable to meet any dependencies it will fail, and tell you why.

sudo apt-get -t experimental install $package_name

This will install $package_name and all of its dependencies from experimental. Take a close look at any dependencies that are being upgraded. This is where things could get dangerous.

Note by anonymous: I highly recommend using this second method as often times packages will have specific version dependencies in testing/unstable/experimental.


apt-show-versions is also a handy package to keep track of what you have installed from outside stable.
Install the apt-show-versions command:

apt-get install apt-show-versions

List the packages from various repos:

apt-show-versions | grep /testing
apt-show-versions | grep /unstable
apt-show-versions | grep /experimental



Errata

jollysnowman wrote:

I have a question though about what happens when a package starts to advance through the repos. Once iceweasel 4 moves from experimental to unstable to testing, will apt pick it up, allowing me to get security updates?

It should work this way. If a higher version of a package is available in a more "stable" repository it will be installed. I have observed this on a few packages on my system; for instance, I originally installed nvidia-kernel-dkms from the experimental repository, and then it moved from experimental --> unstable --> testing while updating. There is a newer version in experimental, but I have to install that manually.


UPDATE May 2 2011
My instructions will keep a stable base and let you install packages from other repositories. If you would rather have a rolling release #! based on testing/unstable check out the instructions jotapesse posted here. Thanks jotapesse, for the how to, and for helping me improve mine as well!


For more information:
This might help if things go horribly smile
AptPreferences - Debian Wiki
Apt Pinning for Beginners
Debian pinning errata
man apt_preferences
This was mostly stolen from these pages.

Last edited by hardran3 (2013-09-20 15:51:51)

Offline

Be excellent to each other!

#2 2011-03-08 08:13:55

olembe
#! Junkie
From: Salisbury, England
Registered: 2009-04-29
Posts: 263

Re: Apt Pinning and You: Living on the Edge with #!

Thank you for this. I've been wanting an easy to understand guide to app pinning so this is great.

Offline

#3 2011-03-08 09:52:55

omns
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,131

Re: Apt Pinning and You: Living on the Edge with #!

Nice one smile Despite Squeeze offering greater stability I can see many wanting to try new packages before they hit backports.

I can feel another sticky coming on but remember, you use this guide at your own peril!

Offline

#4 2011-03-08 10:00:22

hardran3
#! Junkie
From: forest town, lake land
Registered: 2011-02-26
Posts: 360

Re: Apt Pinning and You: Living on the Edge with #!

omns wrote:

Nice one smile Despite Squeeze offering greater stability I can see many wanting to try new packages before they hit backports.

I can feel another sticky coming on but remember, you use this guide at your own peril!

Absolutely. From the apt_preferences man page:

Preferences are a strong power in the hands of a system administrator but they can become also their biggest nightmare if used without care! APT will not questioning the preferences so wrong settings will therefore lead to uninstallable packages or wrong decisions while upgrading packages. Even more problems will arise if multiply distribution releases are mixed without a good understanding of the following paragraphs. Packages included in a specific release arent tested in and therefore doesnt always work as expected in older or newer releases or together with other packages from different releases. You have been warned.

If you value stability this may not be for you smile

Offline

#5 2011-03-08 23:53:55

hinto
#! Windbag
From: Cary, NC
Registered: 2010-12-08
Posts: 1,487

Re: Apt Pinning and You: Living on the Edge with #!

Nice


"Sometimes I wish I hadn't taken the red pill" -Me

Offline

#6 2011-03-09 00:52:35

jeffreyC
#! Die Hard
Registered: 2010-09-02
Posts: 596

Re: Apt Pinning and You: Living on the Edge with #!

It is commonly said on the Debian forum 

"If you break it you get to keep both pieces"


There's a reason you separate military and the police. One fights the enemies of the state, the other serves and protects the people. When the military becomes both, then the enemies of the state tend to become the people.

Offline

#7 2011-03-09 02:19:06

anonymous
The Mystery Member
Registered: 2008-11-29
Posts: 9,419

Re: Apt Pinning and You: Living on the Edge with #!

Thank you for making this thread smile

Offline

#8 2011-03-13 07:31:03

hardran3
#! Junkie
From: forest town, lake land
Registered: 2011-02-26
Posts: 360

Re: Apt Pinning and You: Living on the Edge with #!

anonymous wrote:

Thank you for making this thread smile

No problem. I felt sad about losing PPA's switching from Ubuntu until I figured this out, and I like to help.

Offline

#9 2011-03-15 01:16:28

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,131
Website

Re: Apt Pinning and You: Living on the Edge with #!

anonymous wrote:

Thank you for making this thread smile

+1 smile


Ex-developer of #! CrunchBang. Follow me on Twitter smile

Offline

#10 2011-03-15 01:28:32

hardran3
#! Junkie
From: forest town, lake land
Registered: 2011-02-26
Posts: 360

Re: Apt Pinning and You: Living on the Edge with #!

corenominal wrote:
anonymous wrote:

Thank you for making this thread smile

+1 smile

Thanks corenominal, for the props, and for a great linux distro big_smile

Offline

#11 2011-03-19 23:32:26

omns
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,131

Re: Apt Pinning and You: Living on the Edge with #!

@hardran3. Could you clarify for me what this entry does?

Package: *
Pin: release o=Debian
Pin-Priority: -10
0

Edit: nevermind, I should have read the wiki first smile

Offline

#12 2011-03-19 23:55:51

hardran3
#! Junkie
From: forest town, lake land
Registered: 2011-02-26
Posts: 360

Re: Apt Pinning and You: Living on the Edge with #!

omns wrote:

@hardran3. Could you clarify for me what this entry does?

Package: *
Pin: release o=Debian
Pin-Priority: -10
0

Edit: nevermind, I should have read the wiki first smile

I don't think it is necessary actually. One could add this to /etc/apt/preferences

Package: *
Pin: release n=statler
Pin-Priority: 1001

Package: *
Pin: release n=squeeze
Pin-Priority: 900

Package: *
Pin: release o=Debian
Pin-Priority: -10
0

This would let you install packages from any repo, but without automatic updates. Currently my preferences looks like this, and I am updating the OP as well.

Package: *
Pin: release n=statler
Pin-Priority: 1001

Package: *
Pin: release n=squeeze
Pin-Priority: 900

Package: *
Pin: release a=testing
Pin-Priority: 800

Package: *
Pin: release a=unstable
Pin-Priority: 700

Package: *
Pin: release a=experimental
Pin-Priority: 200

This lets you install from any repo, and automatically installs updates when available. This is slightly more dangerous.

Offline

#13 2011-03-20 22:01:31

jollysnowman
#! CrunchBanger
From: Austin, TX
Registered: 2009-11-17
Posts: 223

Re: Apt Pinning and You: Living on the Edge with #!

Thanks for this! I was just reading on apt-pinning when you posted this thread lol.

Offline

#14 2011-04-02 16:59:54

popslee
#! Member
From: so cal
Registered: 2011-02-11
Posts: 51

Re: Apt Pinning and You: Living on the Edge with #!

Nice guide - thanks ran3

Offline

#15 2011-04-07 01:10:04

donniezazen
New Member
Registered: 2011-04-05
Posts: 6

Re: Apt Pinning and You: Living on the Edge with #!

Thank you for the tutorial. I get following error.

sudo apt-get install chromium-browser/unstable
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Selected version '10.0.648.204~r79063-1' (Debian:unstable [all]) for 'chromium-browser'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
chromium-browser : Depends: chromium (>= 10)
E: Broken packages
donnie@donnie-netbook:~$ sudo apt-get -t experimental chromium-browser
E: Invalid operation chromium-browser
donnie@donnie-netbook:~$ sudo apt-get -t experimental install chromium-browser
Reading package lists... Done
Building dependency tree       
Reading state information... Done
chromium-browser is already the newest version.
The following packages were automatically installed and are no longer required:
  python-software-properties unattended-upgrades python-gnupginterface
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 148 not upgraded.

apt-cache policylicy chromium-brows
chromium-browser:
  Installed: 9.0.597.45~r70550-1
  Candidate: 9.0.597.45~r70550-1
  Version table:
     10.0.648.204~r79063-1 0
        700 http://ftp.us.debian.org/debian/ unstable/main i386 Packages
*** 9.0.597.45~r70550-1 0
        990 http://packages.crunchbanglinux.org/statler/ statler/main i386 Packages
        100 /var/lib/dpkg/status
     6.0.472.63~r59945-5+squeeze4 0
        900 http://http.us.debian.org/debian/ squeeze/main i386 Packages
        800 http://ftp.us.debian.org/debian/ testing/main i386 Packages

Offline

#16 2011-04-07 01:13:19

anonymous
The Mystery Member
Registered: 2008-11-29
Posts: 9,419

Re: Apt Pinning and You: Living on the Edge with #!

Try this way:

sudo apt-get -t unstable install chromium-browser

Offline

#17 2011-04-07 01:25:28

donniezazen
New Member
Registered: 2011-04-05
Posts: 6

Re: Apt Pinning and You: Living on the Edge with #!

anonymous wrote:

Try this way:

sudo apt-get -t unstable install chromium-browser

sudo apt-get -t unstable install chromium-browser
[sudo] password for donnie:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
chromium-browser is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 524 not upgraded.

Offline

#18 2011-04-07 01:27:55

anonymous
The Mystery Member
Registered: 2008-11-29
Posts: 9,419

Re: Apt Pinning and You: Living on the Edge with #!

I suppose you could try uninstalling it and the reinstalling.

Offline

#19 2011-04-07 01:49:14

donniezazen
New Member
Registered: 2011-04-05
Posts: 6

Re: Apt Pinning and You: Living on the Edge with #!

No, it still installs the same version. I have just installed chrome dev version and removed chromium-browser. Thanks.

Offline

#20 2011-04-19 20:06:44

hardran3
#! Junkie
From: forest town, lake land
Registered: 2011-02-26
Posts: 360

Re: Apt Pinning and You: Living on the Edge with #!

donniezazen wrote:

No, it still installs the same version. I have just installed chrome dev version and removed chromium-browser. Thanks.

Packages in experimental are quite often broken. I tried it today and it is working. Sorry for the late reply, I was on vacation and lacked internet.

Offline

#21 2011-04-20 21:53:24

crunchy
#! Junkie
From: Juneau, AK, USA
Registered: 2010-08-19
Posts: 461

Re: Apt Pinning and You: Living on the Edge with #!

okay. so I've added the repositories and can install stuff. Right now I'm trying to install xfce4.8 and it's giving lots of errors saying that it requires orage and stuff with a higher version so I typed those in too and it gave me LOTS of other ones that I really don't want to have to type in too. is there a easy way to do this?

EDIT: nevermind did a man apt-get roll

sudo apt-get install xfce4 -t unstable

that worked fine. it's installing stuff right now.

Last edited by crunchy (2011-04-20 22:02:15)


registered Linux user: #533379
registered #! user: #6769
Whenever someone calls me a computer 'nerd' or a 'Unix-based-system'
all I can think is: You just wait. In a couple of years. I'll be your IT. Then where will you be!

Offline

#22 2011-04-20 22:01:26

anonymous
The Mystery Member
Registered: 2008-11-29
Posts: 9,419

Re: Apt Pinning and You: Living on the Edge with #!

What command did you use to install xfce 4.8? Try this:

sudo apt-get -t unstable install xfce4

Offline

#23 2011-04-20 22:02:52

crunchy
#! Junkie
From: Juneau, AK, USA
Registered: 2010-08-19
Posts: 461

Re: Apt Pinning and You: Living on the Edge with #!

anonymous wrote:

What command did you use to install xfce 4.8? Try this:

sudo apt-get -t unstable install xfce4

look at my edit smile


registered Linux user: #533379
registered #! user: #6769
Whenever someone calls me a computer 'nerd' or a 'Unix-based-system'
all I can think is: You just wait. In a couple of years. I'll be your IT. Then where will you be!

Offline

#24 2011-04-20 22:19:26

omns
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,131

Re: Apt Pinning and You: Living on the Edge with #!

crunchy wrote:

that worked fine. it's installing stuff right now.

How did it go?

Offline

Be excellent to each other!

#25 2011-04-20 22:23:31

crunchy
#! Junkie
From: Juneau, AK, USA
Registered: 2010-08-19
Posts: 461

Re: Apt Pinning and You: Living on the Edge with #!

omns wrote:
crunchy wrote:

that worked fine. it's installing stuff right now.

How did it go?

I'm on a REALLY slow internet right now. it's take about another 30 minutes. right now I'm half-way through.

I'll let you know how it goes/how it looks. smile

EDIT: it looks great. unfortunately it killed my system. smile oh well :sigh: I'll reinstall it later. smile

well. maybe it didn't. big_smile is there a reason for synaptic saying stuff like

can't access the download directory

and stuff like that?

Last edited by crunchy (2011-04-21 00:58:45)


registered Linux user: #533379
registered #! user: #6769
Whenever someone calls me a computer 'nerd' or a 'Unix-based-system'
all I can think is: You just wait. In a couple of years. I'll be your IT. Then where will you be!

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo