# apt-get apache2 problem - Debian



## ScottG489 (Aug 9, 2008)

So my problem is pretty simple. I just installed Debian onto one of my old computers to use it as a server. I am trying to download and install apache2 using "apt-get install apache2". However, when I type that, I get this error:

Reading package lists... Done
Building dependency tree... 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

First let me get a few things out of the way. Yes I am logged in with root privileges by using "su" and logging in before I use apt-get ("sudo" isn't on this system for w/e reason). I have also looked around on Google without too much luck.

Does anyone know what the problem is and how to fix it? Thanks in advance!


----------



## shuuhen (Sep 4, 2004)

It's probably in a repository your system is not pointed to. I think you can add them with dselect. However, I also remember something about it clobbering my old list of repositories. Consider adding a few more repositories (I don't remember how in Debian).


----------



## ScottG489 (Aug 9, 2008)

Ok, well I probably should have pointed out that I'm pretty new to Linux. Meaning in this case, I don't know how to add a new list of repositories.


----------



## shuuhen (Sep 4, 2004)

Depends on the distro. I don't have access to a Debian or Debian-based distro at the moment, but I should be messing with one sometime soon, so I may know more later. A distribution should have good documentation and Debian's should help. Here's a specific page that should help: http://www.debian.org/doc/manuals/apt-howto/

There's a page on there about adding mirrors. You probably should make a copy of the /etc/apt/sources.list file before modifying it.


----------



## wmorri (May 29, 2008)

Scott here is the problem I believe with the "apt-get install apache2". You need to type this instead:

```
sudo apt-get install apache2
```
However, if you are trying to install a LAMP server then I would recommend that you take a look at this LAMP server. It is very simple and might help you out with installing MySQL and PHP, too.

Cheers!


----------



## ScottG489 (Aug 9, 2008)

Well like I said in my post, sudo isn't on my server (basically I get this error: "bash: sudo: command not found"). So what I do instead is just type "su" and login while apt-get'ting.

I also took a look at that LAMP tutorial. Thanks a lot for it. I actually was planning on apt-get'ting most of the programs on there. So its nice to know that I am doing it right. It has some other good info too though. Thanks again.

Btw, I am currently adding repositories to my sources.list file. I gotta go to work now and then tonight, but ill hopfully have this problem resolved when I get back.

The repositories I added were:

deb http://ftp.us.debian.org/debian/ etch main contrib non-free
deb-src http://ftp.us.debian.org/debian/ etch main contrib non-free

After I did that it installed correctly. I was also told to add these too by someone else:

deb http://http.us.debian.org/debian stable main contrib non-free
deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free

It doesn't seem like it could hurt to have more repositories. Even though it is already working I don't see how adding more repositories would be a problem.

Anyways, off to work. Thanks for all your help.


----------

