How to turn off the i386 architecture under Linux


foreword

In order to install Wine QQ, the i386 (that is, 32-bit) architecture was enabled on Zorin OS (Linux distribution, based on Ubuntu 20) to support the operation of 32-bit applications. But later, I found that the software could not be installed and uninstalled normally. The person who tied the bell has to be untied. Since the i386 architecture is enabled, we will turn it off.
insert image description here

Turn i386 on and off

enable i386

Support for i386 can be enabled with one line of command. Enter: in the terminal sudo dpkg --add-architecture i386.

turn off i386

When you want to turn off i386, you will find that it doesn't work at all. After input sudo dpkg --remove-architecture i386, the terminal prompts: dpkg: 错误: 无法移除体系结构 i386 ,当前它仍被数据库使用.

Uninstall all 32-bit apps

Why do you say "still used by the database"? Because there are 32-bit applications installed in the system, it is they that prevent the shutdown of i386. Therefore, all 32-bit applications need to be uninstalled. input the command:

$ sudo apt-get remove --purge `dpkg --get-selections | awk '/i386/{print $1}'`

At this time, if a large number of "uninstalling" words appear in the terminal, then congratulations! Finally, enter a line of commands:

$ sudo dpkg --remove-architecture i386

Then you're done!

Circular dependencies between packages

However, sometimes a nasty situation arises: packages depend on each other. Software A depends on B, B depends on C, and C depends on A, so the software cannot be uninstalled at all. At this time, we have to force uninstall the software to break the dependency chain, and then follow the above steps to uninstall normally.
insert image description here
For packages that cannot be uninstalled due to dependencies, we use dpkg to uninstall. Here is an example of uninstalling "deepin-wine-helper":

$ sudo dpkg --purge --force-all deepin-wine-helper
dpkg: deepin-wine-helper:i386:有依赖问题,但是如您所愿,将继续卸载:
 spark-dwine-helper 依赖于 deepin-wine-helper (>= 5.1).

(正在读取数据库 ... 系统当前共安装有 360652 个文件和目录。)
正在卸载 deepin-wine-helper:i386 (5.1.43-1) ...
正在清除 deepin-wine-helper:i386 (5.1.43-1) 的配置文件 ...
正在处理用于 libc-bin (2.31-0ubuntu9.9) 的触发器 ...
/sbin/ldconfig.real: File /lib/libactivation.so is empty, not checked.

According to this method, all software packages that cannot be uninstalled normally due to dependencies are forcibly uninstalled, and finally there are two more lines of commands:

$ sudo apt-get remove --purge `dpkg --get-selections | awk '/i386/{print $1}'`
$ sudo dpkg --remove-architecture i386

Then, it's OK! The software updater works normally again.
insert image description here


Summarize

The above are the steps to turn off i386. Let's review it together:

#如果有循环依赖,则使用dpkg --purge --force-all <软件包> 来卸载它。
$ sudo dpkg --purge --force-all deepin-wine-helper
#卸载所有32位应用
$ sudo apt-get remove --purge `dpkg --get-selections | awk '/i386/{print $1}'`
#最后关闭i386架构
$ sudo dpkg --remove-architecture i386

Your praise is my biggest motivation!

Guess you like

Origin blog.csdn.net/jzwalliser/article/details/128408035