Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have just installed these packages for building my owncloud, but always get an installation aborted error:

rqie@rqie-VirtualBox:~$ sudo apt-get install apache2 php5 php5-json php5-gd php5-sqlite curl libcurl3 libcurl3-dev php5-curl php5-common php-xml-parser
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'php5-common' instead of 'php5-json'
Note, selecting 'libcurl4-openssl-dev' instead of 'libcurl3-dev'
php-xml-parser is already the newest version.
apache2 is already the newest version.
curl is already the newest version.
libcurl3 is already the newest version.
libcurl4-openssl-dev is already the newest version.
php5 is already the newest version.
php5-common is already the newest version.
php5-curl is already the newest version.
php5-gd is already the newest version.
php5-sqlite is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up qmail (1.06-4) ...

The hostname -f command returned: $1

Your system needs to have a fully qualified domain name (fqdn) in
order to install the var-qmail packages.

Installation aborted.

dpkg: error processing qmail (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of qmail-run:
 qmail-run depends on qmail (>= 1.06-2.1); however:
  Package qmail is not configured yet.
dpkg: error processing qmail-run (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 qmail
 qmail-run
E: Sub-process /usr/bin/dpkg returned an error code (1)

anyone can help me ? thanks advanced

share|improve this question

2 Answers 2

From the logs you show with your question, you have obviously a problem with the installation of a package. But the problem is not with the packages you were asking installation : apache2 php5 php5-json php5-gd php5-sqlite curl libcurl3 libcurl3-dev php5-curl php5-common php-xml-parser. Look at the line containing is already the newest version. All these packages are already installed.

The error is left by a previous tentative to install qmail which didn't succeed because of the hostname not having a fully qualified name. As said before, setup a hostname like host.domain.tld by modifying /etc/hosts and /etc/hostname. You should have at least in /etc/hosts a line saying :

<your ip> <hostname.domain.tld> <hostname>

If you are on a computer with dynamic IP address, use 127.0.0.1 as <your ip>. Or use the static ip you have received.

So you can already play around with Apache and PHP, unless the hostname problem stops Apache from working properly.

share|improve this answer

Your system needs to have a fully qualified domain name (fqdn) in order to install the qmail packages. You probably have not set a domain, only a local hostname in /etc/hosts. Also, a computer talks to itself using a reserved network address (usually 127.0.0.1). In actual fact this is done via the kernel, but it still uses the networking process. More info on fdqn here.

First you should stop the mail service using:

~$ service qmail stop

or:

~$ /etc/init.d/qmail stop

Next remove the qmail pkg completely:

~ $ sudo apt-get purge qmail

Edit /etc/hosts

~ $ sudo nano /etc/hosts

Find the line:

127.0.0.1 hostname 

Change to:

127.0.0.1 --fqdn www.yourdomain.com hostname

Next reinstall the qmail packages remembering your domain set in hosts.

On next reboot check with:

hostname 

hostname -f

This should confirm your changes.

share|improve this answer
    
i find 127.0.0.1 hostname , can you explain and give me example about 127.0.0.1 --fdqn www.yourdomain.com hostname . what should i fill ? –  user254556 Mar 18 at 8:36
    
What happens when you type hostname in a terminal? –  bleeves Mar 18 at 8:40
    
127.0.0.1 localhost 127.0.1.1 rqie-VirtualBox # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters that in my terminal, i confuse what sholud i change –  user254556 Mar 18 at 8:45
    
You need a domain name of your own to host a mail server. You can not use a pre-existing one (such as ubuntu.com). You then need to update etc/hosts and /etc/hostnames respectively. –  bleeves Mar 18 at 8:57
    
oke i'll try, thanks –  user254556 Mar 18 at 9:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.