3

I Uninstall my apach2 from Ubuntu because it looks not working now I tried to install it again with the command sudo apt install apache2

and I can see the below errors

E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/pool/main/a/apr/libapr1_1.7.0-8ubuntu0.22.04.1_amd64.deb  Could not resolve 'mirrors.cloud.aliyuncs.com'
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/pool/main/a/apr-util/libaprutil1_1.6.1-5ubuntu4.22.04.2_amd64.deb  Could not resolve 'mirrors.cloud.aliyuncs.com'
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/pool/main/a/apr-util/libaprutil1-dbd-sqlite3_1.6.1-5ubuntu4.22.04.2_amd64.deb  Could not resolve 'mirrors.cloud.aliyuncs.com'
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/pool/main/a/apr-util/libaprutil1-ldap_1.6.1-5ubuntu4.22.04.2_amd64.deb  Could not resolve 'mirrors.cloud.aliyuncs.com'
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/pool/main/a/apache2/apache2-bin_2.4.52-1ubuntu4.7_amd64.deb  Could not resolve 'mirrors.cloud.aliyuncs.com'
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/pool/main/a/apache2/apache2-data_2.4.52-1ubuntu4.7_all.deb  Could not resolve 'mirrors.cloud.aliyuncs.com'
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/pool/main/a/apache2/apache2-utils_2.4.52-1ubuntu4.7_amd64.deb  Could not resolve 'mirrors.cloud.aliyuncs.com'
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/pool/main/a/apache2/apache2_2.4.52-1ubuntu4.7_amd64.deb  Could not resolve 'mirrors.cloud.aliyuncs.com'
E: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/pool/main/s/ssl-cert/ssl-cert_1.1.2_all.deb  Could not resolve 'mirrors.cloud.aliyuncs.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I tried apt-get update and now there are below warnings

W: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/dists/jammy/InRelease  Could not resolve 'mirrors.cloud.aliyuncs.com'
W: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/dists/jammy-updates/InRelease  Could not resolve 'mirrors.cloud.aliyuncs.com'
W: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/dists/jammy-backports/InRelease  Could not resolve 'mirrors.cloud.aliyuncs.com'
W: Failed to fetch http://mirrors.cloud.aliyuncs.com/ubuntu/dists/jammy-security/InRelease  Could not resolve 'mirrors.cloud.aliyuncs.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

And when I run the below command it gives error

sudo systemctl status apache2

Error: Unit apache2.service could not be found.

and after

sudo ufw app list

It says: Available applications:

  • OpenSSH
  • iperf

So now I am unable to install apache2 on Ubuntu

12
  • Try sudo apt install apache2 again, edit your question and add the exact error message that you get.
    – Jos
    Feb 25 at 18:23
  • Just because you uninstalled it and installed it again does not mean you fixed the problem that kept it from working before. Feb 25 at 18:34
  • @Jos I edited my question Feb 25 at 18:35
  • 3
    I doubt whether mirrors.cloud.aliyuncs.com is a proper and trusted mirror. What is your usual Ubuntu mirror?
    – Jos
    Feb 25 at 18:42
  • Sorry @Jos I am almost a newbie to Ubuntu So don't know about mirrors. I was following the tutorial somewhere on a site. Feb 25 at 18:45

1 Answer 1

11

For some reason that we don't know, the name of the mirror server for your installation has been changed to an untrusted mirror called mirrors.cloud.aliyuncs.com. That is not a regular Ubuntu mirror, and certainly didn't come with the installation of your Ubuntu system. This server isn't even responding at this moment.

You can change it back to a trusted mirror, either manually by editing /etc/apt/sources.list and each *.list file in /etc/apt/sources.list.d; or by using the graphic utility software-properties-gtk, as recommended by @Raffa.

A trusted mirror is usually a web server called xxx.ubuntu.com where xxx is a code specific to your country.

However, after installing something, check back to the *.list files and see if they haven't changed back. If your system was somehow hacked, it may be hacked again. If that is the case, nothing less than a complete reinstall is safe.

4
  • 1
    Your solution worked. I just edited the /etc/apt/sources.list file manually and changed the mirrors accordingly, and after that, I installed apache2 and it installed correctly. Feb 25 at 19:44
  • 2
    There are vps/server providers that host their own internal mirrors for customers (internal network, so, fast) but don't want the world to use them, so don't add them to an official list. Their initial setup typically points to those internal mirrors, so a situation like this isn't that rare. Feb 26 at 7:28
  • 3
    True, but in a case like that I think @KashifSohail should be able to find out how and why mirrors.cloud.aliyuncs.com was set as the system's mirror server. If they can't, then this looks quite suspicious and it would be prudent to react as though the system has been hacked.
    – David Z
    Feb 26 at 8:47
  • 3
    mirrors.cloud.aliyuncs.com is the official Alibaba cloud mirror, according to alibabacloud.com/help/en/ecs/user-guide/… - it may just be broken.
    – abligh
    Feb 26 at 16:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .