[Solved] Removing i386 architecture

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
akuankkis
Posts: 84
Joined: 2011-10-09 09:29
Been thanked: 1 time

[Solved] Removing i386 architecture

#1 Post by akuankkis »

I have no use to i386 programs anymore. I tried to remove all i386 packages but can't remove all.

Code: Select all

root@ic2:~# apt-get remove --purge `dpkg --get-selections | awk '/i386/{print $1}'`
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  gcc-12-base:i386* libc6:i386* libcrypt1:i386* libgcc-s1:i386*
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  libcrypt1:i386 libc6:i386 (due to libcrypt1:i386) libgcc-s1:i386
  gcc-12-base:i386 (due to libgcc-s1:i386)
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
After this operation, 13.0 MB disk space will be freed.
E: Removing essential system-critical packages is not permitted. This might break the system.
Why I get that error and warning message?
How to force removing?
Why it is dangerous?
Last edited by akuankkis on 2024-10-12 18:47, edited 1 time in total.

User avatar
Uptorn
Posts: 423
Joined: 2022-01-22 01:07
Has thanked: 331 times
Been thanked: 112 times

Re: Removing i386 architecture

#2 Post by Uptorn »

You are using multiarch to have both i386 and amd64. The correct way to remove i386 is to:

Code: Select all

dpkg --remove-architecture i386
Then running apt autopurge should clean up the unused packages. Or, as recommended by the Debian wiki multiarch page, run:

Code: Select all

apt-get purge ".*:i386"

akuankkis
Posts: 84
Joined: 2011-10-09 09:29
Been thanked: 1 time

Re: Removing i386 architecture

#3 Post by akuankkis »

I get this error message and I have only those 4 i386 packages installed.

Code: Select all

root@ic2:~# dpkg --remove-architecture i386
dpkg: error: cannot remove architecture 'i386' currently in use by the database

Aki
Global Moderator
Global Moderator
Posts: 4036
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 112 times
Been thanked: 532 times

Re: Removing i386 architecture

#4 Post by Aki »

Hello,
akuankkis wrote: 2024-10-11 14:50 I get this error message and I have only those 4 i386 packages installed.

Code: Select all

root@ic2:~# dpkg --remove-architecture i386
dpkg: error: cannot remove architecture 'i386' currently in use by the database
Perhaps, there's is still some package installed:
  • sources / dpkg / 1.22.11 / src / main / main.c

    Code: Select all

    [..]
    static int
    arch_remove(const char *const *argv)
    {
      const char *archname = *argv++;
      struct dpkg_arch *arch;
      struct pkg_hash_iter *iter;
      struct pkginfo *pkg;
    
      if (archname == NULL || *argv)
        badusage(_("--%s takes exactly one argument"), cipaction->olong);
    
      modstatdb_open(msdbrw_readonly);
    
      arch = dpkg_arch_find(archname);
      if (arch->type != DPKG_ARCH_FOREIGN) {
        warning(_("cannot remove non-foreign architecture '%s'"), arch->name);
        return 0;
      }
    
      /* Check if it's safe to remove the architecture from the db. */
      iter = pkg_hash_iter_new();
      while ((pkg = pkg_hash_iter_next_pkg(iter))) {
        if (pkg->status < PKG_STAT_HALFINSTALLED)
          continue;
        if (pkg->installed.arch == arch) {
          if (in_force(FORCE_ARCHITECTURE))
            warning(_("removing architecture '%s' currently in use by database"),
                    arch->name);
          else
            ohshit(_("cannot remove architecture '%s' currently in use by the database"),
                   arch->name);
          break;
        }
      }
      pkg_hash_iter_free(iter);
    
      dpkg_arch_unmark(arch);
      dpkg_arch_save_list();
    
      modstatdb_shutdown();
    
      return 0;
    }
    [..]
    
Perhaps this happens because some i386 packages cannot be removed; from your first post:

Code: Select all

WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  libcrypt1:i386 libc6:i386 (due to libcrypt1:i386) libgcc-s1:i386
  gcc-12-base:i386 (due to libgcc-s1:i386)
I suspect the libc6:i386 package cannot be removed, resulting in other packages not being removed.

Is the amd64 version installed?

Hope this helps.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

akuankkis
Posts: 84
Joined: 2011-10-09 09:29
Been thanked: 1 time

Re: Removing i386 architecture

#5 Post by akuankkis »

--force-remove-protected was right option. Now i368 architecture is gone and all works fine.

Code: Select all

dpkg --purge --force-remove-protected {gcc-12-base,libc6,libcrypt1,libgcc-s1}:i386
dpkg --remove-architecture i386

DebianFox
Posts: 191
Joined: 2024-05-05 14:11
Has thanked: 23 times
Been thanked: 15 times

Re: [Solved] Removing i386 architecture

#6 Post by DebianFox »

@Best_Threads

Post Reply