Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I got every time failed to fetch for apt-get install default-jdk and openjdk-6-jdk

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  ca-certificates-java fontconfig fontconfig-config hicolor-icon-theme
  icedtea-6-jre-cacao icedtea-6-jre-jamvm icedtea-netx icedtea-netx-common
  java-common libasound2 libasyncns0 libatk-wrapper-java
  libatk-wrapper-java-jni libatk1.0-0 libatk1.0-data libcairo2 libdatrie1
  libflac8 libfontconfig1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgif4
  libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libice-dev libice6 libjasper1
  libjpeg-turbo8 libjpeg8 libjson0 libogg0 libpango1.0-0 libpixman-1-0
  libpthread-stubs0 libpthread-stubs0-dev libpulse0 libsm-dev libsm6
  libsndfile1 libthai-data libthai0 libtiff4 libvorbis0a libvorbisenc2
  libx11-dev libx11-doc libxau-dev libxcb-render0 libxcb-shm0 libxcb1-dev
  libxcomposite1 libxcursor1 libxdamage1 libxdmcp-dev libxfixes3 libxft2
  libxi6 libxinerama1 libxrandr2 libxrender1 libxt-dev libxt6 libxtst6
  openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib shared-mime-info
  ttf-dejavu-core ttf-dejavu-extra tzdata-java x11-common x11proto-core-dev
  x11proto-input-dev x11proto-kb-dev xorg-sgml-doctools xtrans-dev
Suggested packages:
  default-jre equivs libasound2-plugins libasound2-python librsvg2-common gvfs
  libjasper-runtime ttf-baekmuk ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp
  ttf-arphic-gkai00mp ttf-arphic-bkai00mp pulseaudio libxcb-doc openjdk-6-demo
  openjdk-6-source visualvm icedtea-plugin libnss-mdns sun-java6-fonts
  fonts-ipafont-gothic fonts-ipafont-mincho ttf-wqy-microhei ttf-wqy-zenhei
  ttf-indic-fonts-core ttf-telugu-fonts ttf-oriya-fonts ttf-kannada-fonts
  ttf-bengali-fonts
The following NEW packages will be installed:
  ca-certificates-java fontconfig fontconfig-config hicolor-icon-theme
  icedtea-6-jre-cacao icedtea-6-jre-jamvm icedtea-netx icedtea-netx-common
  java-common libasound2 libasyncns0 libatk-wrapper-java
  libatk-wrapper-java-jni libatk1.0-0 libatk1.0-data libcairo2 libdatrie1
  libflac8 libfontconfig1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgif4
  libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libice-dev libice6 libjasper1
  libjpeg-turbo8 libjpeg8 libjson0 libogg0 libpango1.0-0 libpixman-1-0
  libpthread-stubs0 libpthread-stubs0-dev libpulse0 libsm-dev libsm6
  libsndfile1 libthai-data libthai0 libtiff4 libvorbis0a libvorbisenc2
  libx11-dev libx11-doc libxau-dev libxcb-render0 libxcb-shm0 libxcb1-dev
  libxcomposite1 libxcursor1 libxdamage1 libxdmcp-dev libxfixes3 libxft2
  libxi6 libxinerama1 libxrandr2 libxrender1 libxt-dev libxt6 libxtst6
  openjdk-6-jdk openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib
  shared-mime-info ttf-dejavu-core ttf-dejavu-extra tzdata-java x11-common
  x11proto-core-dev x11proto-input-dev x11proto-kb-dev xorg-sgml-doctools
  xtrans-dev
0 upgraded, 78 newly installed, 0 to remove and 3 not upgraded.
Need to get 25.3 MB/61.7 MB of archives.
After this operation, 180 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://archive.ubuntu.com/ubuntu/ precise-updates/main openjdk-6-jre-headless amd64 6b24-1.11.5-0ubuntu1~12.04.1 [25.3 MB]
Fetched 25.3 MB in 4s (5325 kB/s)                 
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/o/openjdk-6/openjdk-6-jre-headless_6b24-1.11.5-0ubuntu1~12.04.1_amd64.deb  Hash Sum mismatch
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

thanks for you help

share|improve this question
    
Note to close-voters: This is not a duplicate of Trouble downloading updates due to “Hash sum mismatch” error as it's not about package lists, but about the actual package files. –  gertvdijk Feb 4 '13 at 13:46
add comment

1 Answer 1

It appears that the downloaded package has corrupted in some way and this is detected by the hash checksum check (that failed as indicated in the error message). It could be either become corrupted on your local machine or on the Ubuntu mirror you're using.1

Try running

sudo apt-get clean all
sudo apt-get update

And then re-attempt the installation.

If that doesn't fix it, try changing the mirror: How can I get apt to use a mirror close to me, or choose a faster mirror?

1 Very unlikely in your case, as you're using the main archive. But for similar other users bumping into this, it is useful to mention.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.