Tag: apt error

  • apt error doesn’t support architecture ‘i386’

    apt error doesn’t support architecture ‘i386’

    On an Ubuntu server, when running “apt update” command, I got the following error message

    root@s196379:~# apt update
    Hit:1 http://mirror.fcix.net/ubuntu focal InRelease
    Hit:2 http://mirror.fcix.net/ubuntu focal-updates InRelease                
    Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease           
    Hit:4 https://mirror.rackspace.com/mariadb/repo/10.5/ubuntu focal InRelease
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    All packages are up to date.
    N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://mirror.rackspace.com/mariadb/repo/10.5/ubuntu focal InRelease' doesn't support architecture 'i386'
    root@s196379:~# 
    

    This error is because the repository do not support i386. To fix the error, edit the file

    vi /etc/apt/sources.list
    

    Find

    deb https://mirror.rackspace.com/mariadb/repo/10.5/ubuntu focal main
    

    Replace with

    Find

    deb [arch=amd64] https://mirror.rackspace.com/mariadb/repo/10.5/ubuntu focal main
    

    Solution 2: Remove i386 support

    Check your architecture

    dpkg --print-architecture 
    

    If you are using 64 bit OS, you will see amd64.

    Check if multiarch is enabled

    dpkg --print-foreign-architectures
    

    If you get “i386”, you have multiarch enabled.

    If you don’t have any i386 applications running, you can remove i386 support with

    dpkg --remove-architecture i386
    

    If you want to enable i386 support, you can run

    dpkg --add-architecture i386
    

    Back to apt

  • apt error after MariaDB to MySQL change

    I have install MariaDB on a Ubuntu 16.04 server. Then installed Virtualmin, that require MySQL, so it removed MariaDB and installed MySQL, this caused apt stop working.

    When i run “apt update”, it failed with

    root@ok-vm:~# apt upgrade
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    You might want to run 'apt-get -f install' to correct these.
    The following packages have unmet dependencies:
     mysql-server : Depends: mysql-server-5.7 but it is not installed
    E: Unmet dependencies. Try using -f.
    root@ok-vm:~#
    

    Next i run ‘apt-get -f install’ as it said in above error message.

    root@ok-vm:~# apt-get -f install
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Correcting dependencies... Done
    The following additional packages will be installed:
      mysql-server-5.7
    Suggested packages:
      mailx tinyca
    The following NEW packages will be installed:
      mysql-server-5.7
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    167 not fully installed or removed.
    Need to get 0 B/2,708 kB of archives.
    After this operation, 48.3 MB of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Preconfiguring packages ...
    (Reading database ... 120876 files and directories currently installed.)
    Preparing to unpack .../mysql-server-5.7_5.7.20-0ubuntu0.16.04.1_amd64.deb ...
    Aborting downgrade from (at least) 10.0 to 5.7.
    If are sure you want to downgrade to 5.7, remove the file
    /var/lib/mysql/debian-*.flag and try installing again.
    dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.20-0ubuntu0.16.04.1_amd64.deb (--unpack):
     subprocess new pre-installation script returned error exit status 1
    Errors were encountered while processing:
     /var/cache/apt/archives/mysql-server-5.7_5.7.20-0ubuntu0.16.04.1_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    root@ok-vm:~#
    

    That too failed. The error message is

    Preparing to unpack …/mysql-server-5.7_5.7.20-0ubuntu0.16.04.1_amd64.deb …
    Aborting downgrade from (at least) 10.0 to 5.7.

    This is because MySQL detected MairaDB data files in /var/lib/mysql folder, it can’t use same data files as MariaDB is newer version.

    To fix the problem, i renamed the folder

    mv /var/lib/mysql /var/lib/mysql-old
    

    Now running “apt-get -f install” fixed the problem with apt.

    apt-get -f install
    
  • apt doesn’t support architecture i386

    After adding facebook hhvm repository on Ubuntu 16.04, i get following error when running “apt update” command.

    root@backup:~# apt-get update
    Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
    Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease                                                                                                       
    Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]                                                                                      
    Hit:4 http://ftp.osuosl.org/pub/mariadb/repo/10.1/ubuntu xenial InRelease                                                                                        
    Ign:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease                                                                                        
    Get:6 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]                                                                                    
    Hit:7 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease                   
    Hit:8 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release             
    Ign:10 https://pkg.jenkins.io/debian-stable binary/ InRelease
    Hit:11 https://download.docker.com/linux/ubuntu xenial InRelease
    Hit:12 https://pkg.jenkins.io/debian-stable binary/ Release
    Get:13 https://dl.hhvm.com/ubuntu xenial InRelease [2,411 B]
    Get:15 https://dl.hhvm.com/ubuntu xenial/main amd64 Packages [2,244 B]
    Fetched 311 kB in 1s (283 kB/s)
    Reading package lists... Done
    N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://dl.hhvm.com/ubuntu xenial InRelease' doesn't support architecture 'i386'
    root@backup:~#
    

    This is fixed by editing

    vi /etc/apt/sources.list
    

    Find

    deb https://dl.hhvm.com/ubuntu xenial main
    

    Replace with

    deb [arch=amd64] https://dl.hhvm.com/ubuntu xenial main