shasum报错含义解析及Ubuntu 17.10安装Elasticsearch 5.6.4的解决方法
First, let's break down what this error actually means:
elasticsearch-5.0.0.deb.sha1: no properly formatted SHA1 checksum lines found
This message tells you the system can't parse your SHA1 checksum file correctly. Standard SHA1 checksum files follow a strict structure: a 40-character SHA1 hash, followed by either two spaces or a tab, then the exact filename of the package it's meant to verify. If the file has wrong formatting, mismatched filenames, or corrupt content, you'll hit this error.
Looking at your error, there's an obvious red flag: the checksum file referenced is for elasticsearch-5.0.0.deb, but you're trying to install 5.6.4. That's almost certainly a key part of the problem. Here's how to fix this step by step:
Verify version matching between files
Double-check that you have the correct SHA1 file for Elasticsearch 5.6.4. Your checksum file should be named something likeelasticsearch-5.6.4.deb.sha1, not the 5.0.0 version mentioned in the error. If you downloaded the wrong checksum file, grab the correct one for the 5.6.4 release.Inspect and correct the checksum file format
Open the SHA1 file with a text editor (likenano elasticsearch-5.6.4.deb.sha1). It should contain exactly one line in this format:a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0 elasticsearch-5.6.4.debIf there are extra lines, comments, or the filename doesn't match your actual
.debpackage, clean up the file to match this exact structure.Manually verify the checksum (bypass automatic checks)
If the automatic check keeps failing, verify the package integrity yourself:- Run this command to calculate the SHA1 hash of your
.debfile:sha1sum elasticsearch-5.6.4.deb - Compare the output hash with the value in your SHA1 checksum file. If they match, your package is uncorrupted and safe to install with:
sudo dpkg -i elasticsearch-5.6.4.deb
- Run this command to calculate the SHA1 hash of your
Re-download the checksum file if needed
If you suspect the SHA1 file itself is corrupted or downloaded incorrectly, delete it and re-download the official checksum for Elasticsearch 5.6.4. Make sure the download completes fully without interruptions.
内容的提问来源于stack exchange,提问作者Fatemeh Moh

