I was following a tutorial online so I can install a USB DisplayLink monitor, and it told me to type:
sudo apt-get install git-core gcc-4.6-arm-linux-gnueabi
I tried that, and it says it "cannot locate the package". Please help
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
As RPi Awesomeness points out, run
apt-get update and then
apt-get upgrade before you do anything.
apt-get is part of the Debian package management system used on, e.g., raspbian.
Unless you are certain of what you want to install, it is usually a good idea to see exactly what is available first.
apt-cache search will provide a list matching a string, for example;
> apt-cache search git-core devscripts - scripts to make the life of a Debian Package maintainer easier git - fast, scalable, distributed revision control system git-core - fast, scalable, distributed revision control system (obsolete)
It's not always obvious why the search returns the things it does, but in any case, here we have confirmation that
git-core exists and is available, although there is the note that it is obsolete. We could broaden the seach by using just
git, but this returns more than 500 results. However, if we filter via
man grep), we can apply a regular expression so that only packages with "git" at the beginning of their name are returned:
apt-cache search git | grep "^git"
This limits us to a more manageable 30-40 hits, the first of which is:
git - fast, scalable, distributed revision control system
That's the package you actually want. For "gcc-4.6-arm-linux-gnueabi", we could try
apt-cache search gcc | grep gnueabi -- but that returns nothing. The same regexp trick might work (just plan
search gcc will return way too much again):
apt-cache search gcc | grep "^gcc"
A single screenful, which is easy to glance over. But there is no mention of "gnueabi".
"arm-linux-gnueabi" is actually a tuple used to identify the target of a compiler. In this case, the target is the same as the base system, so we can assume that the normal compiler will work in this case (it would have been good if you had included a link to the instructions you are following). We just need to make sure we get at least version 4.6; the list returned from the last search (which I omitted here) contains reference to 4.4 through 4.7. As it so happens, the current default on raspbian is 4.6, so just plain:
apt-get install gcc
Will do it. Check to make sure afterward with
gcc --version. You should see something like:
gcc (Debian 4.6.3-14+rpi1) 4.6.3 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.