[SOLVED] Dartlang and Flutter package install problems

When using pub or flutter to install libraries it fails with errors like this:

$ flutter packages get
gzip: warning: <stdin>: trailing junk was ignored                       
gzip: warning: <stdin>: trailing junk was ignored                       
tar: Child returned status 1                                            
tar: Error is not recoverable: exiting now                              
tar: Child returned status 1                                            
tar: Error is not recoverable: exiting now                              
gzip: warning: <stdin>: trailing junk was ignored                       
tar: Child returned status 1                                            
tar: Error is not recoverable: exiting now                              
gzip: warning: <stdin>: trailing junk was ignored                       
tar: Child returned status 1                                            
tar: Error is not recoverable: exiting now                              
gzip: warning: <stdin>: trailing junk was ignored                       
tar: Child returned status 1                                            
tar: Error is not recoverable: exiting now         

In Clear Linux pigz is installed and it wraps gzip and gunzip.

The flutter and pub tools require the streaming functionality that real gunzip provides.

To resolve I installed brew for linux. Then ran brew install gzip and then make sure the brew path is preferred in my $PATH.

3 Likes

and does it work now ?

Yes, pub was able to install stagehand and the webdev server.

All good!

1 Like

I will add that the initial ‘compilation’ of the stagehand
AngularDart app with webdev on Windows 10 took 2 minutes 40 seconds and on Clear Linux it took 2 minutes 4 seconds on this Core m3 laptop. The whole development cycle is much quicker.

1 Like

Yes. brew install gzip and add gzip path before $PATH in bashrc to resolve all issues faced in flutter related to gunzip

1 Like

Got the same problem today, /bin/tar works wrong :frowning:

flutter pub get -v 
....
[        ] IO  : Spawning "/bin/tar --warning=no-unknown-keyword --extract --gunzip --no-same-owner --no-same-permissions --directory /home/ice/development/flutter/.pub-cache/_temp/dirSYQITT" in
/home/ice/AndroidStudioProjects/pet_pro/.
[  +23 ms] gzip: warning: <stdin>: trailing junk was ignored
[        ] /bin/tar: Child returned status 1
[        ] /bin/tar: Error is not recoverable: exiting now

@nopro404 thanks for workaround!