红联linux Linux通用技术 - Linux发行版技术 - 企业应用 - 实验室  Linux论坛

您的位置: 红联linux >> Linux实验室 >>

English Linux

>> 查看内容 -学Linux必读Linux学习教程推荐下载发新话题 (游客可发贴)

Getting Sun Java 6 On Debian 4.0 With APT Pinning

rchivedz发布于 2007-11-11 | 次阅读   字号:     (网友评论 0 条) 我要评论


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):

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
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:re-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";}; APT::Cache-Limit "100000000";
Created /etc/apt/preferences: Package: * Pin: release a=stable Pin-Priority: 700 Package: * Pin: release a=unstable Pin-Priority: 600
Run apt-get update
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 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.

 我要评论
发表评论,与各位同人交流。回复请点击下方的我要评论按钮(游客可回复),要发表贴子请点击 发新话题 (游客可发贴)
 热点主题
·Building a LAMP Server
·how-to build fedora7 ker
·Fedora 9 -1 May 2008
·Fedora 8 Server Setup: L
·Linux Java environment s
·Ubuntu Firefox play bbc
·Install Fedora 7 Muti-Me
·JD for Linux C/C++
·Linux file share details
·ubuntu google?
 最新主题
·Job Opportunities in Red
·Linux is Not Windows
·Linux-powered Asus Eee P
·how-to build fedora7 ker
·Fedora 9 -1 May 2008
·Linux Java environment s
·Nine Features Included i
·ubuntu google?
·How to install KDE on Ub
·Step to Config XGL on SU
 关注热点

Linux教程下载?
Linux学习教程推荐下载”(请点击),Linux教程免费下载。

求助Linux问题?
论坛有39版块,覆盖所有Linux技术层面。前往“红联Linux论坛

 

Linux系统教程 | Linux入门 | Linux管理 | Linux技巧 | Linux命令 | Ubuntu系统 | Linux服务器 | Linux数据库 | Linux开发

合作 | 关于我们 | 联系我们 | 导航 | 会员注册

©2017 红联 Powered by SupSite