Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Comments on Hash sum mismatch (only for openjdk-11-jdk)

Parent

Hash sum mismatch (only for openjdk-11-jdk)

+2
−1

I was installing Java yesterday. I had faced lot of problem. I had fixed most of them. But I had changed Hash that's what I think. I don't remember which command I had executed since I had executed lots of command and visited lots of site. Now, whenever I go to install something I get an error which says Hash Sum mismatch.

sudo apt install openjdk-11-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  fonts-dejavu-extra libatk-wrapper-java libatk-wrapper-java-jni openjdk-11-jdk-headless openjdk-11-jre openjdk-11-jre-headless
Suggested packages:
  openjdk-11-demo openjdk-11-source visualvm fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei
The following NEW packages will be installed:
  fonts-dejavu-extra libatk-wrapper-java libatk-wrapper-java-jni openjdk-11-jdk openjdk-11-jdk-headless openjdk-11-jre openjdk-11-jre-headless
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 37.2 MB/264 MB of archives.
After this operation, 413 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 openjdk-11-jre-headless amd64 11.0.11+9-0ubuntu2~20.04 [37.2 MB]
Err:1 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 openjdk-11-jre-headless amd64 11.0.11+9-0ubuntu2~20.04                                                                       
  Hash Sum mismatch
  Hashes of expected file:
   - SHA512:1a641a6e1de844f139fcd1ccd02d3249a633cc2d2be2f38f38aa3822ff103dbf130e98c8693304fc4218ab4a6d79c769e4504a1abc8aaabffea44621d52d422a
   - SHA256:9d469246b988425afdfef1011f72cfc6ece473e4dd35193005a81c7b73d865b6
   - SHA1:fb8ebd20dcc146504898f676c36b07630d46dbf6 [weak]
   - MD5Sum:0928d71a06e6a08c11b0edefe34bc491 [weak]
   - Filesize:37244620 [weak]
  Hashes of received file:
   - SHA512:766c3a8b9a8755136b37b56184295431f4b7cc0ba67bba9cf6b3d6e04b8d2e56d3e1d7c87d07bf0cf72239e1d50515a3a00d8ad056d59f3713cf15e31e6a1e6e
   - SHA256:57423753a08d9aa2305a55faa153ce3d95e7e686410f9478dae1632eb8e33caf
   - SHA1:7bb01794af485a60bc8ddbfbb6b642394a846feb [weak]
   - MD5Sum:750537f5716d978414e321d66a506b00 [weak]
   - Filesize:37244620 [weak]
  Last modification reported: Tue, 27 Apr 2021 17:00:49 +0000
Fetched 37.2 MB in 12s (3,218 kB/s)                                                                                                                                                             
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/o/openjdk-lts/openjdk-11-jre-headless_11.0.11+9-0ubuntu2~20.04_amd64.deb  Hash Sum mismatch
   Hashes of expected file:
    - SHA512:1a641a6e1de844f139fcd1ccd02d3249a633cc2d2be2f38f38aa3822ff103dbf130e98c8693304fc4218ab4a6d79c769e4504a1abc8aaabffea44621d52d422a
    - SHA256:9d469246b988425afdfef1011f72cfc6ece473e4dd35193005a81c7b73d865b6
    - SHA1:fb8ebd20dcc146504898f676c36b07630d46dbf6 [weak]
    - MD5Sum:0928d71a06e6a08c11b0edefe34bc491 [weak]
    - Filesize:37244620 [weak]
   Hashes of received file:
    - SHA512:766c3a8b9a8755136b37b56184295431f4b7cc0ba67bba9cf6b3d6e04b8d2e56d3e1d7c87d07bf0cf72239e1d50515a3a00d8ad056d59f3713cf15e31e6a1e6e
    - SHA256:57423753a08d9aa2305a55faa153ce3d95e7e686410f9478dae1632eb8e33caf
    - SHA1:7bb01794af485a60bc8ddbfbb6b642394a846feb [weak]
    - MD5Sum:750537f5716d978414e321d66a506b00 [weak]
    - Filesize:37244620 [weak]
   Last modification reported: Tue, 27 Apr 2021 17:00:49 +0000
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I had tried to update my system with --fix-missing. I got no error. I had tried following commands

sudo apt-get update
sudo apt-get update --fix-missing
sudo apt-get upgrade

I got no error. I am just getting that error whenever I try to install something.

I had cleaned my system and updated yesterday.

sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get update --fix-missing

I had removed some files also.

sudo rm -rf /var/lib/apt/lists/*

I think clean and above command had done same process. https://askubuntu.com/a/41618/1439690

I have recently installed a random application in my system called Audacious. I got no error for that. But I only get the error for openjdk-11-jdk (It's only happening for jdk related "files" including default-jdk). Even if you look at output of that installation than you will notice my system is saying they need 37.2 MB 37.2 MB/264 MB while the package is 264 MB.

Since I have asked it here that's why I am not going to repost it in Linux CD. Let me say, what I had done to my system. I remember I had installed a software called Bynanz (I think I have misspelled cause I can't find it in my history cause I had searched this in Chrome it's actually video recorder maybe). For the software, I couldn't update my system. That's why I had executed following command.

sudo apt-add-repository -remove ppa:bynanz/....      #I can't remember the file properly that's why I am using ... for that reason.
sudo apt-get update
sudo apt-get upgrade

Before executing the above command, I was getting error while updating my system. I don't remember the error actually also. Cause I just searched in internet about it. So I don't remember anything accurately and I can't find in my Chrome's history. After executing above command I started installing Java, JDK. I was following the article to install Java and JDK.

sudo apt install default-jdk    #I had installed some more software with JDK name but I can't find their name now.
sudo apt install software-properties-common
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EA8CACC073C3DB2A

Yesterday, when I asked the same question somewhere else he told me to execute following commands.

sudo sed -i 's/us.archive.ubuntu.com/archive.ubuntu.com/g' /etc/apt/sources.list  #when I told him that I was facing that error after updating my system and executing the command he told me to executing another sed command
sudo sed -i -re 's/\w+\.archive\.ubuntu\.com/archive.ubuntu.com/g' /etc/apt/sources.list   #I haven't learn sed that's why I usually don't know what the program does. But I know that it is just changing my location of archive (I don't have any idea what it's actually called) in sources.list

So I am going to show my sources.list file here.

# deb cdrom:[Xubuntu 20.04.3 LTS _Focal Fossa_ - Release amd64 (20210819.1)]/ focal main multiverse restricted universe

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://archive.ubuntu.com/ubuntu/ focal universe
deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ focal multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner

deb http://security.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

It's my current "code" in sources.list.

I was looking at my old error and trying to understand what was actually happening. What I understood that is :

The following additional packages will be installed: fonts-dejavu-extra libatk-wrapper-java libatk-wrapper-java-jni openjdk-11-jdk-headless openjdk-11-jre openjdk-11-jre-headless Suggested packages: openjdk-11-demo openjdk-11-source visualvm fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei The following NEW packages will be installed: fonts-dejavu-extra libatk-wrapper-java libatk-wrapper-java-jni openjdk-11-jdk openjdk-11-jdk-headless openjdk-11-jre openjdk-11-jre-headless 0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.

The above code message is saying that I have to install 7 new "things". Since I had earlier run related command that's why I don't have to install some packages again. So the total package is 264 MB. since I had executed similar command that's why I already have some packages in my system those are 264-37.2 MB now I just have to install 37.2 MB since others were installed.

I was executing the similar commands again after opening my laptop again.

$sudo apt-get install default-jdk
[sudo] password for istiak: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  default-jdk-headless default-jre default-jre-headless fonts-dejavu-extra
  libatk-wrapper-java libatk-wrapper-java-jni openjdk-11-jdk
  openjdk-11-jdk-headless openjdk-11-jre openjdk-11-jre-headless
Suggested packages:
  openjdk-11-demo openjdk-11-source visualvm fonts-ipafont-gothic
  fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei
The following NEW packages will be installed:
  default-jdk default-jdk-headless default-jre default-jre-headless
  fonts-dejavu-extra libatk-wrapper-java libatk-wrapper-java-jni
  openjdk-11-jdk openjdk-11-jdk-headless openjdk-11-jre
  openjdk-11-jre-headless
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 37.2 MB/264 MB of archives.
After this operation, 413 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 openjdk-11-jre-headless amd64 11.0.11+9-0ubuntu2~20.04 [37.2 MB]
Fetched 37.2 MB in 15s (2,489 kB/s)                                            
Selecting previously unselected package openjdk-11-jre-headless:amd64.
(Reading database ... 275218 files and directories currently installed.)
Preparing to unpack .../00-openjdk-11-jre-headless_11.0.11+9-0ubuntu2~20.04_amd64.deb ...
Unpacking openjdk-11-jre-headless:amd64 (11.0.11+9-0ubuntu2~20.04) ...
Selecting previously unselected package default-jre-headless.
Preparing to unpack .../01-default-jre-headless_2%3a1.11-72_amd64.deb ...
Unpacking default-jre-headless (2:1.11-72) ...
Selecting previously unselected package openjdk-11-jre:amd64.
Preparing to unpack .../02-openjdk-11-jre_11.0.11+9-0ubuntu2~20.04_amd64.deb ...
Unpacking openjdk-11-jre:amd64 (11.0.11+9-0ubuntu2~20.04) ...
Selecting previously unselected package default-jre.
Preparing to unpack .../03-default-jre_2%3a1.11-72_amd64.deb ...
Unpacking default-jre (2:1.11-72) ...
Selecting previously unselected package openjdk-11-jdk-headless:amd64.
Preparing to unpack .../04-openjdk-11-jdk-headless_11.0.11+9-0ubuntu2~20.04_amd64.deb ...
Unpacking openjdk-11-jdk-headless:amd64 (11.0.11+9-0ubuntu2~20.04) ...
Selecting previously unselected package default-jdk-headless.
Preparing to unpack .../05-default-jdk-headless_2%3a1.11-72_amd64.deb ...
Unpacking default-jdk-headless (2:1.11-72) ...
Selecting previously unselected package openjdk-11-jdk:amd64.
Preparing to unpack .../06-openjdk-11-jdk_11.0.11+9-0ubuntu2~20.04_amd64.deb ...
Unpacking openjdk-11-jdk:amd64 (11.0.11+9-0ubuntu2~20.04) ...
Selecting previously unselected package default-jdk.
Preparing to unpack .../07-default-jdk_2%3a1.11-72_amd64.deb ...
Unpacking default-jdk (2:1.11-72) ...
Selecting previously unselected package fonts-dejavu-extra.
Preparing to unpack .../08-fonts-dejavu-extra_2.37-1_all.deb ...
Unpacking fonts-dejavu-extra (2.37-1) ...
Selecting previously unselected package libatk-wrapper-java.
Preparing to unpack .../09-libatk-wrapper-java_0.37.1-1_all.deb ...
Unpacking libatk-wrapper-java (0.37.1-1) ...
Selecting previously unselected package libatk-wrapper-java-jni:amd64.
Preparing to unpack .../10-libatk-wrapper-java-jni_0.37.1-1_amd64.deb ...
Unpacking libatk-wrapper-java-jni:amd64 (0.37.1-1) ...
Setting up openjdk-11-jre-headless:amd64 (11.0.11+9-0ubuntu2~20.04) ...
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
Setting up openjdk-11-jre:amd64 (11.0.11+9-0ubuntu2~20.04) ...
Setting up openjdk-11-jdk-headless:amd64 (11.0.11+9-0ubuntu2~20.04) ...
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/rmic to provide /usr/bin/rmic (rmic) in auto mode
Setting up fonts-dejavu-extra (2.37-1) ...
Setting up openjdk-11-jdk:amd64 (11.0.11+9-0ubuntu2~20.04) ...
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
Setting up libatk-wrapper-java (0.37.1-1) ...
Setting up default-jre-headless (2:1.11-72) ...
Setting up default-jre (2:1.11-72) ...
Setting up libatk-wrapper-java-jni:amd64 (0.37.1-1) ...
Setting up default-jdk-headless (2:1.11-72) ...
Setting up default-jdk (2:1.11-72) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for fontconfig (2.13.1-2ubuntu3) ...
$sudo apt install openjdk-11-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
openjdk-11-jdk is already the newest version (11.0.11+9-0ubuntu2~20.04).
openjdk-11-jdk set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Didn't you wonder I got no error this time? Another magic is,

Need to get 37.2 MB/264 MB of archives. After this operation, 413 MB of additional disk space will be used.

If I have to install only 37.2 MB in 264 MB than this package should take only 37.2 MB 100 MB in average or in higher 264 MB. But it is taking 413 MB. What?! Really!? It's completely mind-blowing to me. But, it doesn't give me headache cause I remember my experience on Windows that if I had downloaded a file with 100 MB and install that than it takes 1 GB. So I don't care of the message.

After installing those packages I still can't run netbeans..

netbeans
java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-16-openjdk-amd64/lib/libawt_xawt.so
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2387)
	at java.base/java.lang.Runtime.load0(Runtime.java:746)
	at java.base/java.lang.System.load(System.java:1857)
	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
	at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169)
	at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:310)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:280)
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2392)
	at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:808)
	at java.base/java.lang.System.loadLibrary(System.java:1893)
	at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:61)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
	at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:58)
	at java.desktop/sun.awt.PlatformGraphicsInfo.createGE(PlatformGraphicsInfo.java:36)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:93)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:84)
	at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:106)
	at org.netbeans.core.startup.Main.start(Main.java:228)
	at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
	at java.base/java.lang.Thread.run(Thread.java:831
History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

2 comment threads

Possible version mismatch (2 comments)
Package sizes (1 comment)
Post
+4
−0

"Hash Sum mismatch" printed by apt-get on Debian and derivatives means that the file as downloaded had a different cryptographic checksum (hash) than what's listed in the packages list.

In this case, the package list is the one at http://us.archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-amd64 which lists the expected SHA256 hash as 9d469246b988425afdfef1011f72cfc6ece473e4dd35193005a81c7b73d865b6, consistent with what you show but not with the file that apparently ends up being downloaded.

There are four main reasons that I can think of why you might see such an error:

  • The package archive is in the process of being updated; this seems unlikely, and if that's the case, the situation should be resolved soon and after at most an apt-get update
  • There is an error in the packaging process (basically, the distribution vendor screwed up somewhere); if so, if the situation isn't resolved soon, you should file a bug report with them against the affected package
  • Your system is somehow misconfigured, and you need to figure out why it's downloading mismatched package manifests and package files; however, if that were the case, I would expect you to be having similar difficulties with most or all packages, not just a single one
  • There is an active attack going on somewhere, causing you to receive different packages lists and actual package files; in this case, the tools are doing their job by preventing you from installing packages with unexpected, unknown and potentially dangerous contents

You can try to spin up a VM with the same release of Ubuntu and no customizations and try to install the affected package there; if that works, it's likely something local to your system, and you need to figure out in what way it's misconfigured and how to fix that (which is decidedly not a software development problem, but might very well be a Linux question).

If that doesn't work either, and the situation doesn't get resolved in a day or two at most and with no more action on your part than an apt-get update, especially if you haven't made changes to your package manager configuration around the time when this started, then you are likely justified in filing a bug report against the affected package and distribution version with your distribution vendor.

History
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

I had done lots of thing before facing it even I was facing lots of problem before it (1 comment)
I had done lots of thing before facing it even I was facing lots of problem before it
Anonymous‭ wrote over 2 years ago

See the title 🔝. and see my post again...