dpkg: error: cannot remove architecture 'i386' currently in use by the database
Solution 1
From your list, it looks like you just had the 32-bit packages used for Wine. Wine needs a bunch of 32-bit libraries to run 32-bit Windows applications. You won't be able to remove the i386 architecture unless you uninstall the 32-bit Wine. But there's no point in doing this: there's nothing wrong with having the i386 architecture enabled.
Solution 2
Run
dpkg --get-selections | awk '/i386/{print $1}'
And then if happy with them being removed, run
apt-get remove --purge `dpkg --get-selections | awk '/i386/{print $1}'`
And then retry the
dpkg --remove-architecture i386
Related videos on Youtube
daka
Updated on September 18, 2022Comments
-
daka over 1 year
I used this command to add i386 arch:
sudo dpkg --add-architecture i386
And then immediately after without installing any packages I tried to remove the i386 arch like so:
sudo dpkg --remove-architecture i386
And i got the error:
dpkg: error: cannot remove architecture 'i386' currently in use by the database
Solutions I have seen so far involve removing i386 packages, I haven't installed any, the ones that are installed are vital to the functioning of the OS. What do I do?
EDIT, PLEASE READ THE FOLLOWING TO AVOID DESTROYING YOUR OS:
Turns out that 64-bit Linux OSes already include the i386 arch, so the command
sudo dpkg --add-architecture i386
didn't really do anything. -
sunyata over 6 yearsThank you for this, very useful! Do you know if this is safe to do on Ubuntu 16.04 64-bit? I'm asking because I see a long list of packages and am worried that something might go wrong if I remove them all
-
Ludwig Schulze about 6 years@sunyata if your objective is to remove the i386 from your system, then that's the way: remove all i386 packages and then remove the architecture.
-
makkasi over 4 yearsThat helped me. After I removed the i386 I managed to update firefox. Thank you.
-
scrat.squirrel about 4 yearsThanks, that worked wonders -- I had wine32 installed and the whole 32bit arch added because of that. This helped to clean the system.
-
Gilles 'SO- stop being evil' about 4 years@woohoo I don't understand what is “NOT TRUE”. The fact that you can remove it doesn't contradict the fact that it's active by default. Mind you, I haven't checked recently, it may be the case that i386 is no longer active by default now, but you aren't giving me any reason to think that this is the case.
-
scrat.squirrel about 4 yearsYes, i386 is not installed by default on 64bit
-
Juliatzin del Toro almost 4 yearsThis should be the accepted answer! Works like a charm