MongoDB解壓報錯gzip: stdin: not in gzip format的解決方法
在安裝MongoDB時出現如下報錯:
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
- 1.
- 2.
- 3.
- 4.
- 5.
出現這種錯誤的排查方法如下:
1.用重命名的方法
- 1.
進行解壓
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
- 1.
- 2.
- 3.
- 4.
- 5.
發現報錯依舊存在。
2.查看下載的安裝包是否本身就是損壞的 【發生該情況】
total 74M
-rw-r--r-- 1 root root 505K Feb 27 16:57 mongodb-linux-x86_64-4.1.8.tar.gz
- 1.
- 2.
- 3.
發現安裝包只有505k,明顯是下載的安裝包就是損壞的,
3.查看文件的屬性是什麼
mongodb-linux-x86_64-4.1.8.tar.gz: HTML document, UTF-8 Unicode text, with very long lines, with CR, LF line terminators
- 1.
- 2.
發現文件屬性是HTML,所以一直解壓失敗。
說明:
文件的下載鏈接不是直接指向文件,而是先指向一個頁面,在這個頁面裏纔是真的下載鏈接,所以在前一個頁面上直接保存文件,實際上保存的是一個頁面。
假如屬性是bz文件,就用bz文件的解壓方式。
解決方法:
複製下載地址,直接去瀏覽器重新下載即可。
-----------------------------------------要克服生活的焦慮和沮喪,得先學會做自己的主人-----------------------------------------