0

sudo apt install apache2

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package apache2 is not available but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'apache2' has no installation candidate

sudo ufw app list

Available applications:
  OpenSSH

I am trying with this command

root@mydate:~# sudo apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package apache2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'apache2' has no installation candidate




root@mydate:~# sudo apt update
Ign:1 http://archive.ubuntu.com/ubuntu trusty InRelease
Get:2 http://archive.ubuntu.com/ubuntu trusty Release [58.5 kB]
Ign:3 http://rpms.litespeedtech.com/debian focal InRelease
Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease [23.9 kB]
Err:4 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease
Couldn't create temporary file /tmp/apt.conf.BLogEL for passing config to apt-key
Get:5 http://rpms.litespeedtech.com/debian focal Release [1,646 B]
Get:6 http://archive.ubuntu.com/ubuntu trusty Release.gpg [933 B]
Ign:6 http://archive.ubuntu.com/ubuntu trusty Release.gpg
Get:7 http://rpms.litespeedtech.com/debian focal Release.gpg [836 B]
Ign:7 http://rpms.litespeedtech.com/debian focal Release.gpg
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease: Couldn't create temporary file /tmp/apt.conf.BLogEL for passing config to apt-key
E: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu trusty Release: Couldn't create temporary file /tmp/apt.conf.eRadTX for passing config to apt-key
E: The repository 'http://archive.ubuntu.com/ubuntu trusty Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://rpms.litespeedtech.com/debian focal Release: Couldn't create temporary file /tmp/apt.conf.2NAiA5 for passing config to apt-key
E: The repository 'http://rpms.litespeedtech.com/debian focal Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.





root@mydate:~# sudo ufw app list
Available applications:
OpenSSH
root@mydate:~#




root@mydate:~# sudo systemctl status apache2
● apache2.service
Loaded: not-found (Reason: Unit apache2.service not found.)
Active: failed (Result: resources)

Jan 19 06:48:21 mydate systemd[1]: Stopped The Apache HTTP Server.
Jan 19 08:25:00 mydate systemd[1]: apache2.service: Failed to run 'start' task:>
Jan 19 08:25:00 mydate systemd[1]: apache2.service: Failed with result 'resourc>
Jan 19 08:25:00 mydate systemd[1]: Failed to start The Apache HTTP Server.
Jan 19 08:26:21 mydate systemd[1]: apache2.service: Failed to run 'start' task:>
Jan 19 08:26:21 mydate systemd[1]: apache2.service: Failed with result 'resourc>
Jan 19 08:26:21 mydate systemd[1]: Failed to start The Apache HTTP Server.
Jan 19 10:35:01 mydate systemd[1]: apache2.service: Failed to run 'start' task:>
Jan 19 10:35:01 mydate systemd[1]: apache2.service: Failed with result 'resourc>
Jan 19 10:35:01 mydate systemd[1]: Failed to start The Apache HTTP Server.
lines 1-14/14 (END)
muru
  • 193,181
  • 53
  • 473
  • 722
  • Which version of Ubuntu are you running? This will make answering the question much, much easier –  Jan 19 '21 at 12:40
  • Ubuntu Ubuntu is 20.04 – Md Abdul Awal Jan 19 '21 at 12:46
  • Can anyone help me, please! – Md Abdul Awal Jan 19 '21 at 13:15
  • apt update first then try apt install. If it's still having problem, please run `lsb_release -a`, paste it on the question, that would help people. Last try apt search apache2. If there's apache2 packages then it will work. Anyway based on the mirror here, it should contain apache2 package http://mirrors.digitalocean.com/ubuntu/pool/universe/a/apache2/ – Benyamin Limanto Jan 19 '21 at 13:17
  • Silly question, but you did `sudo apt update` *before* trying to install, correct? Otherwise, the `apt` cache will be empty and it won't find anything. –  Jan 19 '21 at 13:31
  • @BenyaminLimanto Please check – Md Abdul Awal Jan 19 '21 at 13:37
  • @Matigo Please check – Md Abdul Awal Jan 19 '21 at 13:37
  • @BenyaminLimanto root@mydate:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal – Md Abdul Awal Jan 19 '21 at 13:38
  • 2
    It's a very bad idea to use Trusty Tahr's (14.04) repo on Focal Fossa (20.04). – Kulfy Jan 19 '21 at 13:39
  • 1
    Does this answer your question? [How do I restore the default repositories?](https://askubuntu.com/questions/124017/how-do-i-restore-the-default-repositories) and [Restore default apt repositories in sources.list from command line](https://askubuntu.com/questions/586595/restore-default-apt-repositories-in-sources-list-from-command-line) – Kulfy Jan 19 '21 at 13:40
  • @Kulfy, I am not sure sir, I am checking – Md Abdul Awal Jan 19 '21 at 13:43
  • 2
    @MdAbdulAwal "please check"? This is looking like a right mess. If you are building a server from scratch, I would strongly suggest starting again because if you are using 20.04 and you're trying to use deprecated package repositories, you will be in a world of hurt. If you are using 20.04, stick with `focal` repositories. Nothing else. –  Jan 19 '21 at 13:53
  • 1
    Where did you get that crazy sources.list? Nuke it from orbit, it's the only way to be safe. – Organic Marble Jan 19 '21 at 14:07

0 Answers0