Downloading 64-bit packages in a 32-bit Ubuntu system

debian_ubuntu_packageYou may have had situations in which the Ubuntu PC connected to the Internet is a 32-bit one and all the packages you download and install using apt-get are 32-bit (i386) packages; but you need 64-bit (amd64) debian (.deb) packages to install them on another Ubuntu machine which is 64-bit. Here’s a workaround.

1. Make sure aptitude package manager is installed on the Internet connected Ubuntu PC. Open the terminal (Ctl+Alt+T) and run the command

$ whatis aptitude
aptitude (8) - high-level interface to the package manager

If you get aptitude:nothing appropriate message, then you need to install the aptitude using apt-get.

$ sudo apt-get update
$ sudo apt-get install aptitude

2. Aptitude’s -o (small oh) switch allows you to specify the key=value pair to inform the architecture. You need to update the package cache and then download the package.

$ sudo aptitude -o APT::Architecture="amd64" update
$ sudo aptitude -o APT::Architecture="amd64" download  package_name

Note that the Architecture is specified as “amd64” which updates the package index for 64-bit packages only. The download option will download the package to the current directory.

You can now copy the *.deb package downloaded to other offline 64-bit Ubuntu PCs and install on them.

Run apt-get update to restore the package index to the correct i386 package information.

Note: If you’re behind proxy, follow this post to set the proxy IP and credentials for apt-get to work through the proxy.

Also as this AskUbuntu answer suggests you can manually download all the packages using the URIs of the package given by the apt-get –print-uris install pkg while installing.

Understand the package management in Debian/Ubuntu platforms and learn more about apt-get and apt-cache.

About Deepak Devanand

Seeker of knowledge
This entry was posted in Ubuntu and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s