The "Unable to locate package" error for i386 packages occurs when apt cannot find 32-bit packages because multiarch support is not enabled or repositories are architecture-restricted. Enable i386 architecture and verify your repository configuration to resolve this.
This error appears when you attempt to install a 32-bit package (using the :i386 suffix) on your system, but apt cannot locate it in available repositories. This typically happens on 64-bit systems where 32-bit architecture support has not been explicitly enabled. The apt package manager searches its cached package lists for the specified architecture, and if it has not been configured to look for i386 packages, the installation fails. Additionally, some repositories may be explicitly configured to only provide packages for amd64 architecture, preventing access to i386 variants even after multiarch is enabled.
First, enable support for 32-bit packages using dpkg:
sudo dpkg --add-architecture i386This command registers i386 as an additional architecture that apt should support. You can verify it worked by checking:
dpkg --print-foreign-architecturesYou should see "i386" listed in the output.
After enabling the architecture, rebuild the apt package cache:
sudo apt updateThis is critical because apt needs to refresh its local cache to recognize i386 packages from all enabled repositories. Without this step, apt will not find the newly available packages.
Some repositories may be restricted to amd64 only. Check your sources:
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d/If you see entries like deb [arch=amd64], you need to modify them to include i386. Edit the file:
sudo nano /etc/apt/sources.listChange lines like:
deb [arch=amd64] http://example.com/ubuntu focal mainTo:
deb [arch=amd64,i386] http://example.com/ubuntu focal mainOr remove the architecture restriction entirely:
deb http://example.com/ubuntu focal mainSave and run sudo apt update again.
Now you can install the 32-bit package using the :i386 suffix:
sudo apt install package-name:i386For example, if you were trying to install libc6 for 32-bit:
sudo apt install libc6:i386You may see a message about installing both amd64 and i386 versions of certain dependencies, which is normal and expected.
For systems that never need 32-bit packages, you can prevent the architecture error entirely by removing i386 support: sudo dpkg --remove-architecture i386 && sudo apt update. This eliminates warnings about repositories not supporting i386. Additionally, some repositories publish packages only for specific architectures by design—check the repository's official documentation to confirm i386 support before attempting installation. On systems using newer APT formats (.sources files in /etc/apt/sources.list.d/), use the same [arch=...] syntax within the Sources entry.
E: Could not connect to proxy server
Could not connect to proxy server
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt
E: The value 'value' is invalid for APT::Default-Release
How to fix invalid APT::Default-Release value in APT
dpkg: error: unable to create new file 'path': Permission denied
How to fix dpkg permission denied errors in APT
subprocess installed post-removal script returned error exit status 1
How to fix "subprocess installed post-removal script returned error exit status 1" in APT