I noticed today that several packages were missing from the Raspbian repositories (I'm on Raspbian Jessie, and I used sudo apt-get update&&sudo apt-get upgrade before everything).

What is this problem, why is it occurring and how to fix it?

pi@raspberrypi:~ $ sudo apt-get install motion
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package motion

I also tried this with other packages.


pi@raspberrypi:~ $ cat /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

apt search motion:

pi@raspberrypi:~ $ apt search motion
Sorting... Done
Full Text Search... Done
fonts-ipafont-nonfree-jisx0208/stable 1:00103-3 all
  Japanese TrueType font, IPAfont (JISX0208)

fonts-roboto/unknown,now 1:4.4.4r2-6+rpi1 all [installed,automatic]
  sans-serif font family released with Android Ice Cream Sandwich

libopencv-calib3d2.4/now armhf [installed,local]
  computer vision Camera Calibration library

libopencv-contrib2.4/now armhf [installed,local]
  computer vision contrib library

libopencv-core2.4/now armhf [installed,local]
  computer vision core library

libopencv-features2d2.4/now armhf [installed,local]
  computer vision Feature Detection and Descriptor Extraction library

libopencv-flann2.4/now armhf [installed,local]
  computer vision Clustering and Search in Multi-Dimensional spaces library

libopencv-highgui2.4/now armhf [installed,local]
  computer vision High-level GUI and Media I/O library

libopencv-imgproc2.4/now armhf [installed,local]
  computer vision Image Processing library

libopencv-legacy2.4/now armhf [installed,local]
  computer vision legacy library

libopencv-ml2.4/now armhf [installed,local]
  computer vision Machine Learning library

libopencv-objdetect2.4/now armhf [installed,local]
  computer vision Object Detection library

libopencv-video2.4/now armhf [installed,local]
  computer vision Video analysis library

vdpau-va-driver/now 0.7.4-3 armhf [installed,local]
  VDPAU-based backend for VA API
  • Something is wrong -- from here apt search motion includes motion/stable 3.2.12+git20140228-4+b2 armhf. – goldilocks Nov 10 '16 at 18:58
  • Could you edit your question and add the content of /etc/apt/sources.list? – joan Nov 10 '16 at 20:04
  • Edited and included /etc/apt/sources.list. – sbrm1 Nov 11 '16 at 11:40
  • Did sudo apt-get update && sudo apt-get upgrade finish without errors? – Dmitry Grigoryev Nov 11 '16 at 12:08
  • @DmitryGrigoryev yeah,, it completed successfully. – sbrm1 Nov 11 '16 at 12:29

It looks like apt-get on your system is in a confused state for some reason. I'd run fsck -n /dev/mmcblk0p1 (assuming that's your root device) to see if the filesystem isn't damaged. If the filesystem is OK, I'd remove files used by apt and start from scratch:

sudo rm -rf /var/cache/apt/* /var/lib/apt/lists/*
sudo apt-get update
sudo apt-get install motion
  • 1
    Thanks, you saved my day. I am scheduled to submit my project tomorrow. – sbrm1 Nov 11 '16 at 15:39

I don't know how the whole mirror handling thing works with Debian/Raspbian/apt. The HTTP based "mirrordirector.raspian.org" repository is browsable and seems the same as archive.raspbian.org. However, in the past I have noticed occasionally that packages available via apt aren't there, so possibly there is no master repo and some things may only be on some mirrors, etc.

Anyway, motion is in both of those if you click through main/m and search down. To save you some time here it is; the packages you are interested in have armhf.deb at the end. There are three versions there; presumably 4.0-1 is Raspbian testing ("stretch") and 3.2.12 is for jessie; the one that showed up via search for me is this one, which is ~18 months newer than the other 3.2.12 package.

You can download that and try to install it directly:

sudo dkpg -i motion_3.2.12+git20140228-4+b2_armhf.deb 

This will fail if dependencies are missing, but it should tell you what they are and you can go through the list manually. It should not be very hard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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