9

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 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/universe libopencvvideo2.3 i386 2.3.1-7 [106 kB]
Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ 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 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/o/opencv/libopencv-video2.3_2.3.1-7_i386.deb  Size mismatch
Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/o/opencv/libopencv-video-dev_2.3.1-7_i386.deb  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 <[email protected]>
Original-Maintainer: Debian Science Team <[email protected]>
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?

5
  • It is 105756 Bytes where 106 is kB, hence 105.756 kB is 106 kB when rounded. Which is approximately same.
    – atenz
    Jul 19, 2012 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, 2012 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, 2012 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, 2012 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, 2012 at 19:17

4 Answers 4

19

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...

6
  • 7
    Le sigh. Gotta love IT people.
    – jrg
    Jul 20, 2012 at 12:50
  • 1
    Proxies/firewalls that return spurious HTML with a 200 OK instead of just blocking the connection are the WORST. :(
    – ish
    Jul 20, 2012 at 18:27
  • Thanks, @Chris ! Huge help. Now I can stop wondering what the hell was going on.
    – hourback
    Oct 9, 2014 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. Mar 22, 2015 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, 2015 at 1:27
4

I had a lot of these problems and I always managed to fix them.

For example:

Failed to fetch http://us-east-1.ec2.archive.ubuntu.com/ubuntu/pool/universe/o/opencv/libopencv-video-dev_2.3.1-7_i386.deb

In this case I would fetch the package manually from the main server like:

wget http://archive.ubuntu.com/ubuntu/pool/universe/o/opencv/libopencv-video-dev_2.3.1-7_i386.deb

Notice I removed the us-east stuff.

then just run:

sudo dpkg -i libopencv-video-dev_2.3.1-7_i386.deb

to install the package.

Then just run the original command you were trying

1
  • Why does apt choke? What are the ramifications of downloading and installing the package that apt choked on?
    – NateS
    Feb 9, 2020 at 12:33
1

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

My repo was for xubuntu:

http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/xUbuntu_15.04/Release

Changed to proper ubuntu:

http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_15.10/Release

Summary: Make sure you have properly setup ppa's urls for your distribution and flavor of Ubuntu.

0

Ok I have experienced this same problem. In my case it was a problem entirely of my own making. I was building new packages for an internal package server and just replacing a package on the server each time without incrementing version numbers ( only me pulling the files ).

My investigations went as follows...

  • run the apt-cache show command - confirm the filesize
  • pull with file by hand - confirm that it in fact a missmatch.
  • manually check the filesize on the package server it matched the apt-cache output

The resulting steps lead me to conclude that my pull of the .deb had been cached.. by our proxy server ( running in transparent mode ). I confirmed that by looking at the proxy logs and it was indeed showing the cache "HIT"

The solution? run the wget command again but force the proxy to refresh

wget http://packages.example.com/pool/contrib/.../packagename.deb --no-cache

that was enough to get the proxy to refresh the file at which point apt-get worked normally.

Obviously its bad form to replace a package without bumping the version number but its another possible cause of this issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .