Search code examples
mysqllinuxubuntuubuntu-24.04

I have problem installing mysql on ubuntu 24.04


I'm encountering problems while trying to install MySQL on my Ubuntu 24.04 system. I'm located in Iran, and I've already tried changing the DNS, using a proxy, and updating the source list, but the issue persists.

Here's what I did:

  1. Ran sudo apt update
  2. Attempted to install MySQL using sudo apt install mysql-server

However, I received the following errors:

Err:1 http://security.ubuntu.com/ubuntu noble-updates/main amd64 mysql-client-core-8.0 amd64 8.0.37-0ubuntu0.24.04.1
404 Not Found [IP: 10.201.176.243 80] Err:2 http://security.ubuntu.com/ubuntu noble-updates/main amd64 mysql-client-8.0 amd64 8.0.37-0ubuntu0.24.04.1 404 Not Found [IP: 10.201.176.243 80] Err:3 http://security.ubuntu.com/ubuntu noble-updates/main amd64 mysql-server-8.0 amd64 8.0.37-0ubuntu0.24.04.1 404 Not Found [IP: 10.201.176.243 80] E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-8.0/mysql-client-core-8.0_8.0.37-0ubuntu0.24.04.1_amd64.deb 404 Not Found [IP: 10.201.176.243 80] E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-8.0/mysql-client-8.0_8.0.37-0ubuntu0.24.04.1_amd64.deb 404 Not Found [IP: 10.201.176.243 80] E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-8.0/mysql-server-8.0_8.0.37-0ubuntu0.24.04.1_amd64.deb 404 Not Found [IP: 10.201.176.243 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I've also tried running sudo apt-get update and using the --fix-missing flag, but these steps didn't resolve the issue.

Has anyone faced a similar problem or have any suggestions on how to fix this?

Thanks in advance for your help!


Solution

  • This may come from an issue with your sources.list.

    Try to edit apt sources located here: /etc/apt/sources.list and use those sources:

    deb http://archive.ubuntu.com/ubuntu noble main restricted
    deb http://archive.ubuntu.com/ubuntu noble-updates main restricted
    deb http://archive.ubuntu.com/ubuntu noble universe
    deb http://archive.ubuntu.com/ubuntu noble-updates universe
    deb http://archive.ubuntu.com/ubuntu noble multiverse
    deb http://archive.ubuntu.com/ubuntu noble-updates multiverse
    deb http://archive.ubuntu.com/ubuntu noble-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu noble-security main restricted
    deb http://security.ubuntu.com/ubuntu noble-security universe
    deb http://security.ubuntu.com/ubuntu noble-security multiverse
    

    Then try again:

    sudo apt-get update
    sudo apt-get install mysql-server
    

    If updating the sources did not worked, you may can try to install MySQL from the official MySQL APT repository.

    wget https://dev.mysql.com/get/mysql-apt-config_0.8.17-1_all.deb
    sudo dpkg -i mysql-apt-config_0.8.17-1_all.deb
    sudo apt update
    sudo apt install mysql-server
    

    If it still does not work, you should look at your DNS.

    edit: /etc/resolv.conf and add Goolge's public DNS:

    nameserver 8.8.8.8
    nameserver 8.8.4.4
    

    Hope this will help.