Download package via apt for another architecture

Yes you can, just append :i386 to the download command, like this:

sudo apt-get download <package>:i386  

So for you:

sudo apt-get download vlc:i386  

I am unaware of any way of automatically downloading a packages dependencies, besides build-dep but that won't work in your case.

After poking in the manpage a bit more, I have found that you can, in fact, use build-dep to an extent like this:

sudo apt-get build-dep --download-only vlc:i386  

Which will then download the required packages into the current directory. Note however, that build-dep is looking at compiling the package from source, not installing it from a .deb so it will suggest things like build-essential and gcc which may be needed to compile vlc, but not necessarily install from a .deb.

It may be easier to list vlc's main dependencies with apt-cache:

apt-cache depends vlc:i386  

If you want to filter by just depends use:

apt-cache depends vlc:i386 | grep 'Depends'  

Note that some packages, like libc6 come by default in Ubuntu, so you won't need to download those. If you just want to download all the dependencies and deal with whether you need them or not later you can use this script:

for i in $(apt-cache depends vlc:i386 | grep -E 'Depends|Recommends|Suggests' | cut -d ':' -f 2,3 | sed -e s/'<'/''/ -e s/'>'/''/); do sudo apt-get download $i 2>>no32.txt; done  

This will download all the dependent, recommended, and suggested packages and reroute any errors to no32.txt. You should take a look in there when you're done, because some needed packages that don't have i386 versions (i.e. they aren't binaries) will be in there.

Just apt-get download those.

Note that this script isn't very smart, it doesn't take a lot of things into account, so you may get some silly errors, it should work in general however.

Tags:

Apt