Setup Development Tools

Setup Development Tools on MB Live

These instructions assume that you have firmware version 01.04.06 installed. If you have an older version, update first before proceeding. If your version is newer, be very careful while proceeding and please update these instructions in case they are outdated.

1. Install gcc and make from lenny

Update the package list and install package gcc-4.2 from lenny using apt-get or aptitude:

# aptitude update
# aptitude install gcc-4.2
# update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.2 42 --slave /usr/bin/cpp cpp /usr/bin/cpp-4.2

Next install package make:
#  aptitude install make

2. Switch to squeeze

In oder to fulfill package dependencies without downgrading you need to install some utilities, header files and libraries from squeeze so that you first have to switch package sources before proceeding. Use nano to edit the file /etc/apt-/sources.list and comment out all the lines with lenny and enable the line which contains the word squeeze.

Misi:~# nano /etc/apt/sources.list

Afterwards the file should look like this:
#deb http://ftp.us.debian.org/debian/ lenny main
#deb-src http://ftp.us.debian.org/debian/ lenny main
#deb http://mirrors.usc.edu/pub/linux/distributions/debian/ lenny main
#deb-src http://mirrors.usc.edu/pub/linux/distributions/debian/ lenny main
#deb http://security.debian.org lenny/updates main
#deb-src http://security.debian.org/ lenny/updates main
deb http://ftp.us.debian.org/debian/ squeeze main
#deb http://ftp.us.debian.org/debian/ sid main
#deb http://ftp.us.debian.org/debian/ experimental main

3. Install public keys and update package list

As the default firmware lacks the public keys for squeeze you will always get a warning that you are trying to install untrusted packages when you install packages from squeeze until you install the packages debian-keyring and debian-archive-keyring which contain the missing keys. Of course you will have to override the warning when you install them.

If you are lazy like me and don't want to install these packages, you can also ignore the warning and go on installing untrusted packages. As far as I know, it doesn't affected system stability, but it's ugly. So I recommend to install them.

Next update the package list ignoring the warning about public key errors:

Misi:~# aptitude update
Get:1 http://ftp.us.debian.org squeeze Release.gpg [1671B]
Hit http://ftp.us.debian.org squeeze/main Translation-de
Hit http://ftp.us.debian.org squeeze Release
Err http://ftp.us.debian.org squeeze Release

Get:2 http://ftp.us.debian.org squeeze Release [79,8kB]
Ign http://ftp.us.debian.org squeeze Release
Ign http://ftp.us.debian.org squeeze/main Packages/DiffIndex
Hit http://ftp.us.debian.org squeeze/main Packages
Fetched 81,5kB in 2s (30,8kB/s)
Reading package lists... Done
W: GPG error: http://ftp.us.debian.org squeeze Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA
W: You may want to run apt-get update to correct these problems

Now you can install packages debian-keyring and debian-archive-keyring:
Misi:~# aptitude install debian-keyring
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reading extended state information       
Initializing package states... Done
Reading task descriptions... Done  
The following NEW packages will be installed:
  debian-keyring 
0 packages upgraded, 1 newly installed, 0 to remove and 267 not upgraded.
Need to get 31,1MB of archives. After unpacking 35,8MB will be used.
WARNING: untrusted versions of the following packages will be installed!

Untrusted packages could compromise your system's security.
You should only proceed with the installation if you are certain that
this is what you want to do.

  debian-keyring 

Do you want to ignore this warning and proceed anyway?
To continue, enter "Yes"; to abort, enter "No": yes
Writing extended state information... Done
Get:1 http://ftp.us.debian.org squeeze/main debian-keyring 2010.12.29 [31,1MB]
Fetched 31,1MB in 31s (977kB/s)                                                                                                                          
Wähle vormals abgewähltes Paket debian-keyring.
(Lese Datenbank ... 
dpkg: Warnung: Dateilisten-Datei des Paketes »ramlog« fehlt, nehme an, dass das Paket derzeit keine Dateien installiert hat.

dpkg: Warnung: Dateilisten-Datei des Paketes »libparted0« fehlt, nehme an, dass das Paket derzeit keine Dateien installiert hat.
(Lese Datenbank ... 24014 Dateien und Verzeichnisse sind derzeit installiert.)
Entpacke debian-keyring (aus .../debian-keyring_2010.12.29_all.deb) ...
Richte debian-keyring ein (2010.12.29) ...
Reading package lists... Done             
Building dependency tree       
Reading state information... Done
Reading extended state information       
Initializing package states... Done
Writing extended state information... Done
Reading task descriptions... Done         

Misi:/DataVolume/shares/Daten/.AppleDB# aptitude install debian-archive-keyring
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reading extended state information       
Initializing package states... Done
Reading task descriptions... Done  
The following packages will be upgraded:
  debian-archive-keyring 
1 packages upgraded, 0 newly installed, 0 to remove and 266 not upgraded.
Need to get 19,9kB of archives. After unpacking 4096B will be used.
Do you want to continue? [Y/n/?] y
WARNING: untrusted versions of the following packages will be installed!

Untrusted packages could compromise your system's security.
You should only proceed with the installation if you are certain that
this is what you want to do.

  debian-archive-keyring 

Do you want to ignore this warning and proceed anyway?
To continue, enter "Yes"; to abort, enter "No": yes
Writing extended state information... Done
Get:1 http://ftp.us.debian.org squeeze/main debian-archive-keyring 2010.08.28 [19,9kB]
Fetched 19,9kB in 0s (20,8kB/s)          
(Lese Datenbank ... 
dpkg: Warnung: Dateilisten-Datei des Paketes »ramlog« fehlt, nehme an, dass das Paket derzeit keine Dateien installiert hat.

dpkg: Warnung: Dateilisten-Datei des Paketes »libparted0« fehlt, nehme an, dass das Paket derzeit keine Dateien installiert hat.
(Lese Datenbank ... 24025 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereiten zum Ersetzen von debian-archive-keyring 2009.01.31 (durch .../debian-archive-keyring_2010.08.28_all.deb) ...
Entpacke Ersatz für debian-archive-keyring ...
Richte debian-archive-keyring ein (2010.08.28) ...
gpg: key F42584E6: "Lenny Stable Release Key <debian-release@lists.debian.org>" not changed
gpg: key 55BE302B: "Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org>" not changed
gpg: key 6D849617: "Debian-Volatile Archive Automatic Signing Key (5.0/lenny)" not changed
gpg: key B98321F9: public key "Squeeze Stable Release Key <debian-release@lists.debian.org>" imported
gpg: key 473041FA: public key "Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>" imported
gpg: Total number processed: 5
gpg:               imported: 2  (RSA: 2)
gpg:              unchanged: 3
gpg: no ultimately trusted keys found
Reading package lists... Done             
Building dependency tree       
Reading state information... Done
Reading extended state information       
Initializing package states... Done
Reading task descriptions... Done  

Current status: 266 updates [-1].

Now if you decide to update the package list once again, you will see that the warning has disappeared:
Misi:~# aptitude update
Get:1 http://ftp.us.debian.org squeeze Release.gpg [1671B]
Hit http://ftp.us.debian.org squeeze/main Translation-de
Hit http://ftp.us.debian.org squeeze Release
Ign http://ftp.us.debian.org squeeze/main Packages/DiffIndex
Hit http://ftp.us.debian.org squeeze/main Packages
Fetched 1671B in 1s (1578B/s)
Reading package lists... Done

4. Install libraries and binutils

Now you are ready to install the utilities, header files and libraries gcc needs to compile and link programs. You start with updating libc6:

Misi:~# aptitude --without-recommends install libc6 libc6-ppc64
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reading extended state information      
Initializing package states... Done
Reading task descriptions... Done  
The following packages will be upgraded:
  libc-bin libc6 libc6-ppc64 
3 packages upgraded, 0 newly installed, 0 to remove and 274 not upgraded.
Need to get 9717kB of archives. After unpacking 16,4kB will be used.
Do you want to continue? [Y/n/?] y
Writing extended state information... Done
Get:1 http://ftp.us.debian.org squeeze/main libc6-ppc64 2.11.2-10 [4485kB]
Get:2 http://ftp.us.debian.org squeeze/main libc-bin 2.11.2-10 [765kB]                                                
Get:3 http://ftp.us.debian.org squeeze/main libc6 2.11.2-10 [4467kB]                                                  
Fetched 9717kB in 16s (590kB/s)                                                                                       
Preconfiguring packages ...
(Lese Datenbank ... 
dpkg: Warnung: Dateilisten-Datei des Paketes »ramlog« fehlt, nehme an, dass das Paket derzeit keine Dateien installiert hat.

dpkg: Warnung: Dateilisten-Datei des Paketes »libparted0« fehlt, nehme an, dass das Paket derzeit keine Dateien installiert hat.
(Lese Datenbank ... 20087 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereiten zum Ersetzen von libc6-ppc64 2.11.2-2 (durch .../libc6-ppc64_2.11.2-10_powerpc.deb) ...
Entpacke Ersatz für libc6-ppc64 ...
Vorbereiten zum Ersetzen von libc-bin 2.11.2-2 (durch .../libc-bin_2.11.2-10_powerpc.deb) ...
Entpacke Ersatz für libc-bin ...
Verarbeite Trigger für man-db ...
Richte libc-bin ein (2.11.2-10) ...
(Lese Datenbank ... 
dpkg: Warnung: Dateilisten-Datei des Paketes »ramlog« fehlt, nehme an, dass das Paket derzeit keine Dateien installiert hat.

dpkg: Warnung: Dateilisten-Datei des Paketes »libparted0« fehlt, nehme an, dass das Paket derzeit keine Dateien installiert hat.
(Lese Datenbank ... 20087 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereiten zum Ersetzen von libc6 2.11.2-2 (durch .../libc6_2.11.2-10_powerpc.deb) ...
Entpacke Ersatz für libc6 ...
Richte libc6 ein (2.11.2-10) ...
Richte libc6-ppc64 ein (2.11.2-10) ...
Reading package lists... Done             
Building dependency tree       
Reading state information... Done
Reading extended state information       
Initializing package states... Done
Reading task descriptions... Done

Finally you have to install libc6-dev and update binutils:
Misi:~# aptitude --without-recommends install libc6-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reading extended state information       
Initializing package states... Done
Reading task descriptions... Done  
The following packages are BROKEN:
  libc6-dev 
The following NEW packages will be installed:
  libc-dev-bin{a} 
The following packages are RECOMMENDED but will NOT be installed:
  manpages-dev 
0 packages upgraded, 2 newly installed, 0 to remove and 274 not upgraded.
Need to get 3104kB of archives. After unpacking 10,8MB will be used.
The following packages have unmet dependencies:
  libc6-dev: Conflicts: binutils (< 2.20.1-1) but 2.18.1~cvs20080103-7 is installed and it is kept back.
The following actions will resolve these dependencies:

Upgrade the following packages:
binutils [2.18.1~cvs20080103-7 (now) -> 2.20.1-16 (stable)]

Score is 120

Accept this solution? [Y/n/q/?] y
The following NEW packages will be installed:
  libc-dev-bin{a} libc6-dev 
The following packages will be upgraded:
  binutils 
The following packages are RECOMMENDED but will NOT be installed:
  manpages-dev 
1 packages upgraded, 2 newly installed, 0 to remove and 273 not upgraded.
Need to get 7213kB of archives. After unpacking 14,4MB will be used.
Do you want to continue? [Y/n/?] y

Writing extended state information... Done
Get:1 http://ftp.us.debian.org squeeze/main binutils 2.20.1-16 [4109kB]
Get:2 http://ftp.us.debian.org squeeze/main libc-dev-bin 2.11.2-10 [208kB]                                            
Get:3 http://ftp.us.debian.org squeeze/main libc6-dev 2.11.2-10 [2896kB]                                              
Fetched 7213kB in 8s (817kB/s)                                                                                        
(Lese Datenbank ... 
dpkg: Warnung: Dateilisten-Datei des Paketes »ramlog« fehlt, nehme an, dass das Paket derzeit keine Dateien installiert hat.

dpkg: Warnung: Dateilisten-Datei des Paketes »libparted0« fehlt, nehme an, dass das Paket derzeit keine Dateien installiert hat.
(Lese Datenbank ... 20087 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereiten zum Ersetzen von binutils 2.18.1~cvs20080103-7 (durch .../binutils_2.20.1-16_powerpc.deb) ...
Entpacke Ersatz für binutils ...
Wähle vormals abgewähltes Paket libc-dev-bin.
Entpacke libc-dev-bin (aus .../libc-dev-bin_2.11.2-10_powerpc.deb) ...
Entpacke libc6-dev (aus .../libc6-dev_2.11.2-10_powerpc.deb) ...
Verarbeite Trigger für man-db ...
Richte binutils ein (2.20.1-16) ...
Richte libc-dev-bin ein (2.11.2-10) ...
Richte libc6-dev ein (2.11.2-10) ...
Reading package lists... Done             
Building dependency tree       
Reading state information... Done
Reading extended state information       
Initializing package states... Done
Writing extended state information... Done
Reading task descriptions... Done

You should look carefully for any lines staring with 'dpkg: error processing …deb'. If a deb package fails to install, it will cause subsequest packages to fail. You will need to forcibly install any debs that fail then re-run the previous aptitude command and repeat until all are installed cleanly. The command to focibly install a failed deb will look something like this:

dpkg -i --force-overwrite /var/cache/apt/archives/libc-bin_2.11.3-3_powerpc.deb

Congratulations! You have successfully set up a development environment on your MB Live and are now ready to compile software packages.

5. Switch back to lenny

After you have installed the development packages from squeeze, it is recommended to switch back to lenny. Revert the changes you made to the file /etc/apt-/sources.list in step 2.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License