Getting "size mismatch" when using apt-get on multiple packages
Solution 1:
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...
Solution 2:
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
Solution 3:
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.