Unable to open a tar.gz file
Solution 1
I would guess that the archive is damaged. Try downloading it again, and even controlling the checksum if an intended value is given at the download site if it does not work.
If it still does not work, try
gunzip mysql-5.1.33.tar.gz
to see if the compression is done correctly, and then
tar xvf mysql-5.1.33.tar
to try to unroll the archive. This will pin point the problem better.
Solution 2
I had the same problem and it turned out that when I had downloaded the .tar.gz file, I had clicked "Download Link" on a page that led to a second page with the actual download.
So, my .tar.gz was just a bunch of HTML.
You can check by posting the address of the .tar.gz in your browser to make sure it's an actual compressed file.
Related videos on Youtube
Andrea Sottosanti
Updated on September 18, 2022Comments
-
Andrea Sottosanti over 1 year
I'm writing a Metropolis-Hastings algorithm for a N(0,1) distribution:
#include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] NumericVector metropolis(int R, double b, double x0){ NumericVector y(R); y(1) = x0; for(int i=1; i<R; ++i){ y(i) = y(i-1); double xs = y(i)+runif(1, -b,b)[0]; double a = dnorm(xs, 0, 1)[0]/dnorm(y(i), 0, 1)[0]; NumericVector A(2); A(0) = 1; A(1) = a; double random = runif(1)[0]; if(random <= min(A)){ y[i] = xs; } } return y; }
but every time I try to compile the function, this error occurs:
Line 12: no matching function for call to 'dnorm4'
I tried to write a trivial function using dnorm, like
NumericVector den(NumericVector y, double a, double b){ NumericVector x = dnorm(y,a,b); return x; }
and it works. Does someone know why I have this type of error in the Metropolis code? Are there some other ways to use density functions in the C++ code like in R?
-
Mike Purcell about 12 yearsTry just unzipping it first, and ensure it's a valid tar file.
-
Admin about 12 yearsThis isn't a suitable question for stackoverflow. Perhaps unix.stackexchange.com. While you're here, what does 'file' tell you about the archive?
-
hkf about 12 yearsunzip with
gzip
first, then usetar
. -
Dirk Eddelbuettel over 7 yearsThere are dozens of suitable examples on the Rcpp Gallery, here on SO and other places.
-
-
stafffan over 7 yearsThanks for this idea. My problem was that the actual file (that I'd tried to curl) didn't exist anymore, so my tar file was actually a 404 page.
-
Dirk Eddelbuettel over 7 yearsThere is also the unaltered interface to R's
Rf_*
functions to I count three. All this has been discussed at length here and on other places. Really no need for a new question, but a fine answer. Thanks, @coatless.