0

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

goldilocks
  • 58,859
  • 17
  • 112
  • 227
AwesomeUser
  • 245
  • 3
  • 17
  • I would have made this a comment but I don't have the privileges. Could you explain why you think this is a kernel error? You didn't supply the error message. Are you sure it contains no useful information for anyone reading your question? – joan Apr 13 '14 at 08:26
  • It said that it could not locate the package. By the way, you now have 56 reputation so you can now comment. – AwesomeUser Apr 13 '14 at 17:25
  • I've edited the question to remove reference to the kernel, since it is not directly involved. – goldilocks Apr 13 '14 at 18:08
  • 1
    Have you run sudo apt-get update lately? – RPiAwesomeness Apr 13 '14 at 18:13
  • 1
    @RPiAwesomeness actually, that was the first thing I did. – AwesomeUser Apr 13 '14 at 18:25
  • Just checking. That is quite often the cause of these errors, so I was just playing it on the safe side. I'm gonna look around a bit and hopefully get you an answer :D BTW, what OS are you using? Raspbian? – RPiAwesomeness Apr 13 '14 at 18:26
  • @RPiAwesomeness Ok. The comment section in the tutorial said "You have to be using 12.04 and everything has to be updated. Install or upgrade to 12.04lts and run sudo apt-get update." 12.04? How do I type that into the console? – AwesomeUser Apr 13 '14 at 18:29
  • Ah, that means this tutorial was meant for Ubuntu. 12.04 LTS is a version of Ubuntu, which came out in April (04) of 2012 (12). That might be your issue, though check out Goldilock's answer, it's impressive and well done. – RPiAwesomeness Apr 13 '14 at 18:31
  • I kind of thought this might be the case (the instructions are for cross compiling). Unless the raspberry pi is mentioned explicitly though, I don't think the stock ubuntu arm cross-compiler will work (it targets armv7, not armv6), so you will have to compile right on the pi. Which is probably easier anyway, although it will be much, much slower. – goldilocks Apr 13 '14 at 18:33
  • 1
    @goldilocks Well, it did say raspberry pi in the title. Here is a link: http://mitchtech.net/raspberry-pi-kernel-compile/ – AwesomeUser Apr 13 '14 at 18:35
  • It's worth a try. I didn't realize you wanted to do the whole kernel, which apparently takes 5+ hours on the pi (but probably only 5-10 minutes on your desktop). The kernel is actually one of the easier things to cross-compile because it doesn't have any dependencies. If it the ubuntu one doesn't work (try a simple "hello world" program first), have a look here: http://raspberrypi.stackexchange.com/questions/1/how-do-i-build-a-gcc-4-7-toolchain-for-cross-compiling/225#225 – goldilocks Apr 13 '14 at 18:40
  • @AwesomeUser That link is for cross-compiling the kernel for use on the Pi, on an Ubuntu system. – RPiAwesomeness Apr 13 '14 at 18:53
  • @RPiAwesomeness which is support to work on Raspbian – AwesomeUser Apr 13 '14 at 19:03
  • Yes. Have you followed Goldilock's answer? – RPiAwesomeness Apr 13 '14 at 19:07
  • @RPiAwesomeness yes, and it said it worked. Here is a link to the original tutorial I was following. http://imkiyoung.wordpress.com/2012/09/18/raspberry-pi-and-aoc-e1649fwu-usb-powered-led-monitor/ – AwesomeUser Apr 13 '14 at 19:10
  • Glad to hear it :) I have considered doing that project myself, just haven't had the time :P – RPiAwesomeness Apr 13 '14 at 19:11
  • @RPiAwesomeness I don't think it completely worked http://tinypic.com/r/99q6wn/8 – AwesomeUser Apr 13 '14 at 19:15
  • "Cross-compiling" refers to compiling an executable for one architecture (e.g., armv6, like the pi) on another (e.g., x86 or x86_64, like a normal PC). So if you are doing the compiling on the pi for the pi, don't use instructions intended for cross compiling! However, you might want to think seriously about it, because as mentioned, it takes quite a few hours to do the kernel right on the pi, and chances are you will screw it up the first few times, and if each time takes 4 hours...basically unless you are already familiar with the process, it is not very feasible. – goldilocks Apr 13 '14 at 19:53

1 Answers1

3

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 grep (see 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.
goldilocks
  • 58,859
  • 17
  • 112
  • 227