Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having trouble getting several packages downloaded using apt-get. So far, I've run into this with 'opencv' and 'gstreamer'. With opencv, it will fetch a number of files then return with the error below. I've tried several different mirrors and they all error on the same file(s).

Do you want to continue [Y/n]? y
Get:1 precise/universe libopencvvideo2.3 i386 2.3.1-7 [106 kB]
Get:2 precise/universe libopencv-video-dev i386 2.3.1-7 [129 kB]
Fetched 2,225 B in 0s (11.8 kB/s)        
Failed to fetch  Size mismatch
Failed to fetch  Size mismatch
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I ran 'apt-cache show libopencv-video*' and got:

Package: libopencv-video2.3
Priority: optional
Section: universe/libs
Installed-Size: 277
Maintainer: Ubuntu Developers <>
Original-Maintainer: Debian Science Team <>
Architecture: i386
Source: opencv
Version: 2.3.1-7
Depends: libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libopencv-core2.3, libopencv-imgproc2.3 (= 2.3.1-7), libstdc++6 (>= 4.1.1)
Filename: pool/universe/o/opencv/libopencv-video2.3_2.3.1-7_i386.deb
Size: 105756
MD5sum: b38c0f11f3856d62168b730522a9691b
SHA1: d45cd609ea497ae72858e0f5914134e124261f22
SHA256: 85e72311ede84efbdd17781cdb04f79818a28968c63f407df6c56efe7da5525e
Description-en: computer vision Video analysis library

When i compare the filesize reported (105756) it does not match the size of the 'deb' package when I pull it down with wget.

Any suggestions as to solving this problem short of using wget on each of the failed files and installing them manually?

share|improve this question
It is 105756 Bytes where 106 is kB, hence 105.756 kB is 106 kB when rounded. Which is approximately same. – atenz Jul 19 '12 at 16:31
right but the filesize of the file (same exact file) that i download using wget is 103kB. seems like the descriptor isn't being updated to match the files? – Chris Jul 19 '12 at 18:49
The downloaded size seems to change a bit few or hundred KB's ( + or - ) depending on size when downloaded onto Local storage. I had always thought it was for CRC or FEC , but then got confused about the BASE in which bits are stored . If it is so , then i am not sure , probably someone will answer . – atenz Jul 19 '12 at 18:58
I'm wondering if they are corrupt packages. should i not be able to download (wget, etc) then install using "dpkg -i <package>" on ubuntu? If so, i'm getting this: – Chris Jul 19 '12 at 19:16
oot@ubuntu:/home/sysadmin# dpkg -i libgstreamer-plugins-base0.10-dev_0.10.36-1ubuntu0.1_i386.deb dpkg-deb: error: `libgstreamer-plugins-base0.10-dev_0.10.36-1ubuntu0.1_i386.deb' is not a debian format archive dpkg: error processing libgstreamer-plugins-base0.10-dev_0.10.36-1ubuntu0.1_i386.deb (--install): subprocess dpkg-deb --control returned error exit status 2 Errors were encountered while processing: libgstreamer-plugins-base0.10-dev_0.10.36-1ubuntu0.1_i386.deb – Chris Jul 19 '12 at 19:17

It turns out that there is not a problem with apt-get but my company. There is an internet policy that blocks all keywords with 'video' in the url. I discovered this by viewing the contents of the libopencv-video2.3_2.3.1-7_i386.deb in /var/cache/apt/archives/partial. It contained html from the web filter giving me a notice that I'm in violation of my internet blah blah blah.

Who would have known that their lead research engineer would have had a policy applied so trivial as this?

Lesson learned: ask your IT dept to give a block of addresses that are exempt from stupid policies and charge them back for the time wasted by me and those trying to help...

share|improve this answer
Le sigh. Gotta love IT people. – James Jul 20 '12 at 12:50
Proxies/firewalls that return spurious HTML with a 200 OK instead of just blocking the connection are the WORST. :( – izx Jul 20 '12 at 18:27
Thanks, @Chris ! Huge help. Now I can stop wondering what the hell was going on. – hourback Oct 9 '14 at 14:32
As a beginner, I am very curious about how you got to that solution (looking in /var/cache/apt/archives/partial). Was it somewhere in the apt-get manual page? Did you find someone else who had the problem? Something else? I'd really like to get better at solving problems without Google when possible. – joshreesjones Mar 22 '15 at 14:25
@mathguy54 I got the same error as the OP. I tried to visit the link (using browser or wget) and the received file was very small. It turns out to be html with message "the url is blocked" – aiao Oct 12 '15 at 1:27

I had alot of these problems and I always seem to fix them quite easy.

e.g Failed to fetch

then I would fetch the package manualy from the main server like: wget notice I removed the us-east stuff. then just run: sudo dpkg -i libopencv-video-dev_2.3.1-7_i386.deb witch should install the package that is bothering you after then just run the orginal command you were tryin should work now...

share|improve this answer

I fixed size mismatch problem when trying to upgrade owncloud. Problem was wrong ppa url.

My repo was for xubuntu: Changed to proper ubuntu: Summary: Make sure you have properly setup ppa's urls for your distribution and flavor of Ubuntu.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.