# snapshot is corrupt



## ccc (Mar 1, 2009)

hi

I try to update ports tree on my freeBSD 7.0 using:
	
	



```
portsnap fetch update
```
but I'm getting this message:
	
	



```
Applying patches... done.
Fetching 106 new ports or files... gunzip: unknown compression format
snapshot is corrupt.
```


----------



## DutchDaemon (Mar 1, 2009)

First test whether your gunzip is ok (create a gzip, then gunzip it). If it is, fetch/extract a new ports tree: 


```
rm /var/db/portsnap/tag && portsnap fetch extract
```

This is usually less troublesome than trying to find out what the specific problem might be.


----------



## Cthulchu (Mar 16, 2009)

hello. 
I have the same trouble. Snapshot corrupted.
I'm not using any proxies.
I have deleted that files in /var/db/portsnap
What can you say about this trouble?


----------



## Cthulchu (Mar 16, 2009)

how can i reinstall gunzip or update portsnap? 
Sorry for qwestions, i'm beginner.


----------



## SirDice (Mar 16, 2009)

Cthulchu said:
			
		

> how can i reinstall gunzip or update portsnap?


They're part of the base OS.


----------



## Cthulchu (Mar 17, 2009)

thank, there was a bad RAM. Fixed. Cool! It works! Great!!! I love this OS!


----------



## embien (Jun 4, 2013)

*portsnap fetch update*

`uname -a` gives:

```
FreeBSD beastie.home 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:15:25 UTC 2012     [email]root@obrian.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  i386
```

Following your suggestion I did `rm /var/db/portsnap/tag && portsnap fetch extract` and then the next day `portsnap fetch update`:

```
Looking up portsnap.FreeBSD.org mirrors... 6 mirrors found.
Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done.
Fetching snapshot metadata... done.
Updating from Mon Jun  3 05:16:47 BST 2013 to Tue Jun  4 11:15:04 BST 2013.
Fetching 3 metadata patches.. done.
Applying metadata patches... done.
Fetching 0 metadata files... done.
Fetching 139 patches.....10....20....30....40....50....60....70....80....90....100....110....120....130.... done.
Applying patches... done.
Fetching 4 new ports or files... done.
Removing old files and directories... rm: /usr/ports/www/moodle: Input/output error
rm: /usr/ports/www/moodle22: Input/output error
done.
Extracting new files:
/usr/ports/LEGAL
/usr/ports/MOVED
... <snip> ...
/usr/ports/www/moodle/
mkdir: /usr/ports/www/moodle: Input/output error
tar: could not chdir to '/usr/ports/www/moodle/'
/usr/ports/www/moodle22/
mkdir: /usr/ports/www/moodle22: Input/output error
tar: could not chdir to '/usr/ports/www/moodle22/'
/usr/ports/www/nginx-devel/
/usr/ports/www/nginx/
... <snip> ...
/usr/ports/x11/xkeyboard-config/
Building new INDEX files... done.
```
Thanks for any help received.


----------



## DutchDaemon (Jun 4, 2013)

Looks like an incomplete or damaged ports tree:

`rm -rf /usr/ports && rm /var/db/portsnap/tag && portsnap fetch extract update`


----------



## SirDice (Jun 4, 2013)

Not related to the problem (@DuthDaemon's solution should work) but:



			
				embien said:
			
		

> `uname -a` gives:
> 
> ```
> FreeBSD beastie.home 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:15:25 UTC 2012     [email]root@obrian.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  i386
> ```


Please upgrade to 9.1, 9.0 has been end-of-life since March 2013.

http://www.freebsd.org/security/unsupported.html


----------

