The Artima Developer Community
Sponsored Link

Java Buzz Forum
Getting Sun Java 6 On Debian 4.0 With APT Pinning

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
Getting Sun Java 6 On Debian 4.0 With APT Pinning Posted: Nov 4, 2007 8:51 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: Getting Sun Java 6 On Debian 4.0 With APT Pinning
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

All the noise about Leopard and Java6 last week made me thinking: Does my favorite operating systems include the JDK? And if so, which version?

The answer, of course, is that Windows does come with a JRE, but it's at version 1.1; and that Debian comes with a incomplete open source JRE that's roughly at version 1.4.

Debian 4.0, however, makes getting the higher versions of Java easy. Sun Java 5 is available in Debian 4.0's stable software repository, while Sun Java 6 is available in the Debian unstable software repository. Since neither are free software, they can only be found in the non-free section of the repositories.

Enabling the non-free section of the stable repository in very easy, as I documented here 136 days ago.

Enabling the unstable repository in Debian 4.0 is something that I don't want to do lightly, for I don't want to upgrade every package in my system to the bleeding edge, at least not yet. Jonathan mentioned "APT pinning" when I asked him about this at the time. And learning about APT pinning I did yesterday.

The three degrees of APT pinning

I have gone through three documents that I found on the Google about APT Pinning.

First there's the very clear Apt-Pinning for Beginners. It outlines exactly what to do to enable the testing and unstable repositories in Debian in such a way as to favor the stable repositories's contents.

But I have some unanswered questions, so I went to the Debian Wiki's AptPinning page. It provided a few more recipe's of doing APT pinning. I particularly like the "only if I say so" approach.

But I still have some unanswered questions, so I went to the authoritative source—the man page of apt_preferences(5). This man page is on my hard drive all along. And to read a printed out copy I issued the command

[weiqi@gao]$ man -Tps apt_preferences | lpr

This six-page document contains explanations of every detail of the things that I need to do.

The steps

Here's the steps I took to get Sun JDK 6 to my Debian GNU/Linux 4.0 system (the right way):

  1. Add a line to /etc/apt/sources.list:
    # deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official amd64 DVD Binary-1 200704
    07-12:15]/ etch contrib main
    
    deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official amd64 DVD Binary-1 20070407
    -12:15]/ etch contrib main
    
    deb http://ftp.debian.org/debian/ etch main non-free
    deb-src http://ftp.debian.org/debian/ etch main non-free
    
    deb http://security.debian.org/ etch/updates main contrib non-free
    deb-src http://security.debian.org/ etch/updates main contrib non-free
    
    deb http://www.debian-multimedia.org etch main
    deb http://www.dipconsultants.com/debian etch main
    
    ### unstable #######
    deb http://ftp.debian.org/debian/ unstable main non-free
  2. Add a line to /etc/apt/apt.conf.d/70debconf:
    // Pre-configure all packages with debconf before they are installed.
    // If you don't like it, comment it out.
    DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};
    APT::Cache-Limit "100000000";
  3. Created /etc/apt/preferences:
    Package: *
    Pin: release a=stable
    Pin-Priority: 700
    
    Package: *
    Pin: release a=unstable
    Pin-Priority: 600
  4. Run apt-get update
  5. Install the eight sun-java6-* packages
    • sun-java6-bin
    • sun-java6-demo
    • sun-java6-doc
    • sun-java6-fonts
    • sun-java6-javadb
    • sun-java6-jdk
    • sun-java6-jre
    • sun-java6-source
    with
    [root@gao]# feta install <package-name>s
    Notice that the sun-java6-doc package requires that I download the JDK documentation from Sun's Java download site and put the zip file in /tmp.

Read: Getting Sun Java 6 On Debian 4.0 With APT Pinning

Topic: Free Session: In-the-Brain of Steve Freeman & Mike Hill on Fit - October 22nd Previous Topic   Next Topic Topic: James Says

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use