# Python27 checksum mismatch



## Grama (Jul 24, 2011)

Hello all,

I am attempting to use FreeBSD on my home server, mostly for SFTP and as a web development testbed.  I am fairly new to FreeBSD, although I have used various Linux distributions as my main OS for some time now.  My main reason for choosing FreeBSD was to learn it, but I digress...

In setting up the server last night, I went to install Python27 from Ports (I am strictly using Ports) and I executed the following command (in /usr/ports/python27, using a recent snapshot of the ports tree):


```
# make install clean
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Found saved configuration for python27-2.7.2_1
===>  Extracting for python27-2.7.2_1
=> SHA256 Checksum mismatch for python/Python-2.7.2.tgz.
===>  Refetch for 1 more times files: python/Python-2.7.2.tgz 
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Found saved configuration for python27-2.7.2_1
=> Python-2.7.2.tgz doesn't seem to exist in /usr/ports/distfiles/python.
=> Attempting to fetch http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
Python-2.7.2.tgz                              100% of   13 MB  162 kBps 00m00s
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Found saved configuration for python27-2.7.2_1
=> SHA256 Checksum mismatch for python/Python-2.7.2.tgz.
===>  Giving up on fetching files: python/Python-2.7.2.tgz 
Make sure the Makefile and distinfo file (/usr/ports/lang/python27/distinfo)
are up to date.  If you are absolutely sure you want to override this
check, type "make NO_CHECKSUM=yes [other args]".
*** Error code 1

Stop in /usr/ports/lang/python27.
*** Error code 1

Stop in /usr/ports/lang/python27.
*** Error code 1

Stop in /usr/ports/lang/python27.
```

and so I then executed the command it suggested,


```
# make install clean NO_CHECKSUM=yes
===>  Vulnerability check disabled, database not found
===>  License check disabled, port has not defined LICENSE
===>  Found saved configuration for python27-2.7.2_1
===>  Extracting for python27-2.7.2_1
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
*** Error code 1

Stop in /usr/ports/lang/python27.
*** Error code 1

Stop in /usr/ports/lang/python27.
```

any suggestions? Your help is greatly appreciated!


----------



## graudeejs (Jul 24, 2011)

try
`# rm -f /usr/ports/distfiles/python/Python-2.7.2.tgz`
and then try to fetch again.

If it fails, I recommend you wait a day, before you try again, or try to fetch distfile from different server by adding something like

```
MASTER_SITE_OVERRIDE=ftp://ftp.lv.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
```
in your /etc/make.conf and then try again.

The reasons for mismatched distfile:
1) distfile was updated, but port wasn't
2) some server was hacked
3) human error
4) something else



Usually such things are fixed withing a day (at least in my experience)



If you're sure nothing was hacked you can

```
# cd /usr/ports/lang/python27
# rm -f distinfo
# make makesum
```

this will regenerate distinfo,
However your problem looks like corrupted tar archive, so this shouldn't help


----------



## wblock@ (Jul 24, 2011)

killasmurf86 said:
			
		

> try
> `# rm -f /usr/ports/distfiles/python/Python-2.7.2.tgz`



A shorter way:
`# make distclean`

Sometimes a partial download causes a checksum mismatch.  It's rare, and hasn't happened enough to provide motivation to track it down.  Removing the partial distfile and re-downloading it fixes it.



> If you're sure nothing was hacked you can



Best contact the maintainer (make maintainer) or submit a PR.  Those checksums are a very basic safety.


----------



## Grama (Jul 24, 2011)

Well,


```
# make distclean
```

worked.  One more tool in the old belt, thanks guys. :e


----------



## graudeejs (Jul 24, 2011)

wblock said:
			
		

> A shorter way:
> `# make distclean`



Nice. I haven't had need for this for VERY long time... no wonder I forgot


----------

