ubuntu里apt-get install java的情况解决
2013-04-08 20:31
309 查看
由于java6的网站变动了,经常不能apt-get,所以记下来......不知道哪里翻到的,所以没有转载地址。
1、添加java6的资源单,这里可以修改source-list更为方便.
$sudo add-apt-repository "deb http://archive.canonical.com/ lucidpartner"
$sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntuhardy main multiverse"
$sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntuhardy-updates main multiverse"
2、更新资源清单:$sudo
apt-get update
3、下载安装java6:$sudo apt-get install sun-java6-jdk
4、配置java环境变量
$sudo vim/etc/environment
添加下面两行内容:
CLASSPATH=.:/usr/lib/jvm/java-6-sun/lib
J***A_HOME=/usr/lib/jvm/java-6-sun
还要将系统虚拟机的优先顺序也调整一下:
$sudovim /etc/jvm
将下面一句写在最顶部:
/usr/lib/jvm/java-6-sun
附:sudo vim /etc/apt/sources.list 修改源会比较方便。
源:
#台湾源
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric main universe restricted multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric main universe restricted multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric-security universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates universe main multiverse restricted
#网易 Ubuntu 11.10 源(速度很快)
deb http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
#骨头源,骨头源是bones7456架设的一个Ubuntu源 ,提供ubuntu,deepin
deb http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse
deb http://ubuntu.srt.cn/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-security universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-updates universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-proposed universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-proposed universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-updates universe main multiverse restricted
#mirror.lupaworld.com的源,速度很快
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn/ oneiric main restricted universe multiverse
#这里你也可以直接使用更快速的ubuntu.cn99.com的源(推荐):
deb http://ubuntu.cn99.com/ubuntu/ oneiric main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ oneiric main restricted universe multiverse
//教育网源
如果大家是在校大学生,可以使用校园网/教育网,就是用教育网的资源吧,中科大,兰大、厦门大学都有很多资源,尤其是支持ipv6的,那更新速度就按兆算了。
中科大:http://mirrors.ustc.edu.cn/
厦门大学:http://mirrors.xmu.edu.cn/howto/
大家可以自己根据自己的版本设置一下,不一定局限于ubuntu 11.10,下面列出一些校内更新源。
#电子科技大学
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
#中国科技大学
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-backports restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
#北京理工大学
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
#兰州大学
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu-cn/ oneiric main multiverse restricted universe
#上海交通大学
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu-cn/ oneiric main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
千万别全部添加了.....很坑的= =
1、添加java6的资源单,这里可以修改source-list更为方便.
$sudo add-apt-repository "deb http://archive.canonical.com/ lucidpartner"
$sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntuhardy main multiverse"
$sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntuhardy-updates main multiverse"
2、更新资源清单:$sudo
apt-get update
3、下载安装java6:$sudo apt-get install sun-java6-jdk
4、配置java环境变量
$sudo vim/etc/environment
添加下面两行内容:
CLASSPATH=.:/usr/lib/jvm/java-6-sun/lib
J***A_HOME=/usr/lib/jvm/java-6-sun
还要将系统虚拟机的优先顺序也调整一下:
$sudovim /etc/jvm
将下面一句写在最顶部:
/usr/lib/jvm/java-6-sun
附:sudo vim /etc/apt/sources.list 修改源会比较方便。
源:
#台湾源
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric main universe restricted multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric main universe restricted multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric-security universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates universe main multiverse restricted
#网易 Ubuntu 11.10 源(速度很快)
deb http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
#骨头源,骨头源是bones7456架设的一个Ubuntu源 ,提供ubuntu,deepin
deb http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse
deb http://ubuntu.srt.cn/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-security universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-updates universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-proposed universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-proposed universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-updates universe main multiverse restricted
#mirror.lupaworld.com的源,速度很快
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn/ oneiric main restricted universe multiverse
#这里你也可以直接使用更快速的ubuntu.cn99.com的源(推荐):
deb http://ubuntu.cn99.com/ubuntu/ oneiric main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ oneiric main restricted universe multiverse
//教育网源
如果大家是在校大学生,可以使用校园网/教育网,就是用教育网的资源吧,中科大,兰大、厦门大学都有很多资源,尤其是支持ipv6的,那更新速度就按兆算了。
中科大:http://mirrors.ustc.edu.cn/
厦门大学:http://mirrors.xmu.edu.cn/howto/
大家可以自己根据自己的版本设置一下,不一定局限于ubuntu 11.10,下面列出一些校内更新源。
#电子科技大学
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
#中国科技大学
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-backports restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
#北京理工大学
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
#兰州大学
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu-cn/ oneiric main multiverse restricted universe
#上海交通大学
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu-cn/ oneiric main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
千万别全部添加了.....很坑的= =
相关文章推荐
- Linux(Ubuntu)使用 sudo apt-get install 命令安装软件的目录在哪?(已解决)
- ubuntu MySQL采用apt-get install安装目录情况
- ubuntu常见错误--Could not get lock /var/lib/dpkg/lock解决 通过终端安装程序sudo apt-get install xxx时出错: E: Coul
- linux(ubuntu)安装软件出现You might want to run 'apt-get -f install' to correct these解决
- 解决ubuntu apt-get install出现E:Clould not get lock /var/lib/dpkg/lock
- ubuntu图下安装软件出现You might want to run 'apt-get -f install' to correct these解决
- Ubuntu apt-get update 无法更新速度是0的情况解决方法
- ubuntu 14.04 apt-get install 不能自动补全解决办法
- Ubuntu用sudo apt-get install时出现“Failed to fetch”的解决办法
- How To Install Java on Ubuntu with Apt-Get
- How To Install Java on Ubuntu with Apt-Get
- How To Install Java on Ubuntu with Apt-Get
- ubuntu图下安装软件出现You might want to run 'apt-get -f install' to correct these解决
- Ubuntu 16.04使用sudo apt-get -f install解决依赖时的注意事项(重点)
- Ubuntu apt-get install 被锁定的解决方法
- ubuntu MySQL采用apt-get install安装目录情况
- Install Java in Ubuntu 10.10 using apt-get
- ubuntu图下安装软件出现You might want to run 'apt-get -f install' to correct these解决
- 安装Ubuntu之后默认英文,选简体中文,正常来说这样装好就应该能用的,可是这个时候又出现了错误,說:broken package database. 请用apt-get install -f解决问题
- 在Ubuntu中,有时候运用sudo apt-get install 安装软件时,会出现一下的情况 E: Could not get lock /var/lib/dpkg/lock - open