LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   FTP service installation error (https://www.linuxquestions.org/questions/debian-26/ftp-service-installation-error-924749/)

s0pan 01-20-2012 02:59 AM

FTP service installation error
 
I'm trying to remove the ftp service so I can reinstall it. Using apt-get remove and apt-get purge didn't remove it properly and apt-get install won't overwrite it. Here's what I get now:

"
:~# apt-get remove vsftpd

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
vsftpd
0 upgraded, 0 newly installed, 1 to remove and 258 not upgraded.
1 not fully installed or removed.
After this operation, 475kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ...
dpkg: warning: files list file for package `ramlog' missing, assuming package has no files currently installed.

dpkg: warning: files list file for package `libparted0' missing, assuming package has no files currently installed.
(Reading database ... 18505 files and directories currently installed.)
Removing vsftpd ...
userdel: error deleting shadow password entry
/usr/sbin/deluser: `/usr/sbin/userdel ftp' returned error code 1. Exiting.
dpkg: error processing vsftpd (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
vsftpd
E: Sub-process /usr/bin/dpkg returned an error code (1)
"

...After rebooting run a couple of more commands:

"
:~# userdel -f ftp
userdel: error deleting shadow password entry

:~# ps -u ftp
PID TTY TIME CMD
"

..? Please advice

Dutch Master 01-21-2012 12:21 AM

Open a terminal, become root and then:
Code:

cp /etc/shadow /etc/shadow.bak
gedit /etc/shadow

Replace gedit with nano if you're on a cli (gedit doesn't work on a cli, it needs a GUI)

Find the ftp entry and remove that line, and ONLY THAT LINE, from the file. But before you do, create a copy, the code above does just that. Re-run the purge command.

s0pan 01-21-2012 08:24 AM

For some reason there was no ftp entry in etc/shadow. It did exist in etc/passwd though.
I copied one of lines in etc/shadow ("ntp:*:14638:0:99999:7:::") and edited it to "ftp:*:14638:0:99999:7:::" then ran "apt-get purge vsftpd". It worked, vsftpd was removed and ftp entries in both "/etc/passwd" and "/etc/shadow" vanished, excellent!
Now to install anew:
Code:

:~# apt-get install vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  vsftpd
0 upgraded, 1 newly installed, 0 to remove and 258 not upgraded.
Need to get 143kB of archives.
After this operation, 475kB of additional disk space will be used.
Get:1 http://ftp.us.debian.org squeeze/main vsftpd 2.3.2-3+squeeze2 [143kB]
Fetched 143kB in 1s (84.1kB/s)
Preconfiguring packages ...
(Reading database ...
dpkg: warning: files list file for package `ramlog' missing, assuming package has no files currently installed.

dpkg: warning: files list file for package `libparted0' missing, assuming package has no files currently installed.
(Reading database ... 18505 files and directories currently installed.)
Unpacking vsftpd (from .../vsftpd_2.3.2-3+squeeze2_powerpc.deb) ...
dpkg: error processing /var/cache/apt/archives/vsftpd_2.3.2-3+squeeze2_powerpc.deb (--unpack):
 trying to overwrite '/etc/logrotate.d/vsftpd', which is also in package wd-nas 01.00.01-46026
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/vsftpd_2.3.2-3+squeeze2_powerpc.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Sorry but you didn't think it would be that easy huh?
OK checked last modified file date it's 2011-05-07 so indeed overwrite did not happen, here's the contents of "/etc/logrotate.d/vsftpd":
Code:

/var/log/vsftpd.log
{
  create 640 root adm

  # ftpd doesn't handle SIGHUP properly
  missingok
  notifempty

}

Great so I figured if I run mv "/etc/logrotate.d/vsftpd" "/etc/logrotate.d/vsftpd.bak" to rename the file it doesn't have to overwrite.
But, it made no difference! "apt-get install vsftpd" gives the same output as above, even when "/etc/logrotate.d/vsftpd" does not even exist.
Unpack seems to fail, how to proceed?

62chevy 01-21-2012 11:03 AM

Try apt-get with the ' -f ' option.

Code:

apt-get -f install

Dutch Master 01-21-2012 11:05 AM

Good to see you've made such good progress on your own! :)

Apt is using the package from its cache to install, and that might be obsolete or corrupt. Clear the cache so apt is forced to fetch the latest version. Btw, did you removed it with the remove or purge option? In case of the former, try the latter first, as it'll remove any associated config files with it. Your message also shows an unfulfilled dependency and a conflict with the wd-nas package. Unless you explicitly need it, I'd suggest to purge it from the system too, to avoid such conflict. But it may be a dependency of the vsftpd package, I don't know...

PS: I assume you've already refreshed the package list with apt-get update... If you haven't, do so before continuing!!

s0pan 01-21-2012 11:22 AM

Solved
 
Thanks for the guidelines, finally got it installed!

dpkg -i --force-overwrite /var/cache/apt/archives/vsftpd_2.3.2-3+squeeze2_powerpc.deb


All times are GMT -5. The time now is 08:57 PM.