Ubuntu: Limit apt repo to a certain arch?



Question:

I have several repositories that don't have armhf (for RPi cross-compiler) binaries, so it always gives me a carp ton of 404 errors on updating package lists. it also prevents me from running do-release-upgrade as it can't find armhf compiled system binaries, that it doesn't need and can't run anyways. I'm looking for a way to tell it to only search for specific arches in certain repositories so I can fix the massive wall of 404s on apt-get update. Google was no help, so as far as I know this isn't a dupe, and the one question that was possibly related was about GPG errors, of which I have none.

sources.list: http://pastebin.com/3RTLat0m
output of apt-get update: http://pastebin.com/Yb1J2DYd
dkpg arches: i386, amd64, armhf
I'm using an ARM cross compiler as raspberry pi is very slow to compile larger things, and crashes on some huge ones, even with a 4GB swapfile on an external drive


Solution:1

From man sources.list:

The format for a sources.list entry using the deb and deb-src types is:       deb [ options ] uri suite [component1] [component2] [...]  ...   options is always optional and needs to be surrounded by square  brackets. It can consist of multiple settings in the form  setting=value. Multiple settings are separated by spaces. The following  settings are supported by APT (note however that unsupported settings  will be ignored silently):    ·   arch=arch1,arch2,...  can be used to specify for which      architectures information should be downloaded. If this option is      not set all architectures defined by the APT::Architectures option      will be downloaded.     ·   arch+=arch1,arch2,...  and arch-=arch1,arch2,...  which can be used      to add/remove architectures from the set which will be downloaded.         ...  The first line gets package information for the architectures in  APT::Architectures while the second always retrieves amd64 and armel.           deb http://ftp.debian.org/debian wheezy main         deb [ arch=amd64,armel ] http://ftp.debian.org/debian wheezy main  

So try something like:

deb [ arch=armhf ] http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi armhf  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »