본문 바로가기
알아두면 손해 없는 정보 저장소

Solaris에서 .tar.gz 파일 untar 안될 때, 해결 방법

by anothel 2022. 3. 16.

압축이 안 풀린다고?

압축은 풀어야겠는데 내가 알던 상식으로는 압축이 안 풀렸다. 솔라리스 8, 9, 10에서는 안 되는 걸 확실하게 확인했고, 11에서는 되는 것을 확실하게 확인했다.

 

$ tar -xvf pressedFile.tar.gz
tar: directory checksum error(디렉토리 체크섬 오류)

$ uname -a
SunOS mars 5.8 Generic_117350-62 sun4u sparc SUNW,Sun-Fire-V240

 

낮은 버전(10 이하)의 솔라리스에서 .tar.gz 파일 압축 해제 방법

솔라리스 2.5 이상 10 이하의 버전의 tar는 z 옵션이 없기 때문인데, 낮은 버전의 솔라리스에서 정 압축을 풀고 싶으면 이렇게 하면 된다.

 

$ gunzip -c pressedFile.tar.gz | tar xvf -

 

위의 명령어를 그림으로 그리면 대충 이렇다

 

p.s. gzip은 보통 tar와 같이 사용되는 것이 일반적이다. .tar.gz로 압축된 파일의 경우 zip과 압축 알고리즘은 같지만 더 용량이 적다. 이는 .tar.gz의 경우 서로 다른 파일끼리의 중복되는 부분을 압축시킬 수 있기 때문이다. 아울러 대부분의 리눅스 배포판에 포함되어 있는 tar 유틸리티는 .tar.gz 파일을 z 옵션으로 압축(해제)할 수 있다.

 

Reference

- https://en.wikipedia.org/wiki/Gzip

- https://en.wikipedia.org/wiki/Tar_(computing) 

- https://www.ibm.com/docs/en/aix/7.1?topic=t-tar-command 

- https://linux.die.net/man/1/tar

- https://datastory.tistory.com/8

- https://stackoverflow.com/questions/7120232/untar-a-file-on-solaris-reports-tar-directory-checksum-error

 

728x90