PDA

View Full Version : [ubuntu] How to Force Remove a package (bandwidthd)



Antonorsi
February 26th, 2012, 05:11 AM
Hello, I tried to install "bandiwdth' from their page bandwidthd.sourceforge.net/ but in the middle of the installation it gave me an error and now I can't either remove it o reinstall it.

This is what happens if I do sudo dpkg --force-all -P bandwidthd

carlosf@CarlosF-HP:~$ sudo dpkg --force-all -P bandwidthd
[sudo] password for carlosf:
dpkg: warning: overriding problem because --force enabled:
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
(Reading database ... 180101 files and directories currently installed.)
Removing bandwidthd ...
/etc/init.d/bandwidthd: 19: Syntax error: "(" unexpected
invoke-rc.d: initscript bandwidthd, action "stop" failed.
dpkg: error processing bandwidthd (--purge):
subprocess installed pre-removal script returned error exit status 2
update-rc.d: warning: /etc/init.d/bandwidthd missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
/etc/init.d/bandwidthd: 19: Syntax error: "(" unexpected
invoke-rc.d: initscript bandwidthd, action "start" failed.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
bandwidthd

help?

HeroOfCanton
February 26th, 2012, 05:30 AM
Hello, I tried to install "bandiwdth' from their page bandwidthd.sourceforge.net/ but in the middle of the installation it gave me an error and now I can't either remove it o reinstall it.

This is what happens if I do sudo dpkg --force-all -P bandwidthd

carlosf@CarlosF-HP:~$ sudo dpkg --force-all -P bandwidthd
[sudo] password for carlosf:
dpkg: warning: overriding problem because --force enabled:
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
(Reading database ... 180101 files and directories currently installed.)
Removing bandwidthd ...
/etc/init.d/bandwidthd: 19: Syntax error: "(" unexpected
invoke-rc.d: initscript bandwidthd, action "stop" failed.
dpkg: error processing bandwidthd (--purge):
subprocess installed pre-removal script returned error exit status 2
update-rc.d: warning: /etc/init.d/bandwidthd missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
/etc/init.d/bandwidthd: 19: Syntax error: "(" unexpected
invoke-rc.d: initscript bandwidthd, action "start" failed.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
bandwidthd

help?

Did you try reinstalling first like the error message suggested? You seem to be doing it correctly.

Antonorsi
February 26th, 2012, 04:59 PM
Yep, I tried to (well, I think that I tried haha)

LONG post, sorry

aptdcon --reinstall bandwidthd



The following package will be upgraded (1):
bandwidthd
The following package will be reinstalled (1):
bandwidthd
After this operation, 86.0 kB of additional disk space will be used.
Do you want to continue [Y/n]?y
Preconfiguring packages ...
cp: cannot stat `/usr/share/doc/bandwidthd/bandwidthd.conf': No such file or directory
bandwidthd failed to preconfigure, with exit status 1
Preconfiguring packages ...
cp: cannot stat `/usr/share/doc/bandwidthd/bandwidthd.conf': No such file or directory
bandwidthd failed to preconfigure, with exit status 1
Preconfiguring packages ...
cp: cannot stat `/usr/share/doc/bandwidthd/bandwidthd.conf': No such file or directory
bandwidthd failed to preconfigure, with exit status 1
Selecting previously deselected package bandwidthd.
(Reading database ... 180102 files and directories currently installed.)
Preparing to replace bandwidthd 2.0.1 (using .../bandwidthd_2.0.1+cvs20090917-4.1_i386.deb) ...
/etc/init.d/bandwidthd: 19: Syntax error: "(" unexpected
invoke-rc.d: initscript bandwidthd, action "stop" failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 2
dpkg - trying script from the new package instead ...
/etc/init.d/bandwidthd: 19: Syntax error: "(" unexpected
invoke-rc.d: initscript bandwidthd, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/bandwidthd_2.0.1+cvs20090917-4.1_i386.deb (--unpack):
subprocess new pre-removal script returned error exit status 2
No apport report written because MaxReports is reached already
update-rc.d: warning: /etc/init.d/bandwidthd missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
/etc/init.d/bandwidthd: 19: Syntax error: "(" unexpected
invoke-rc.d: initscript bandwidthd, action "start" failed.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/bandwidthd_2.0.1+cvs20090917-4.1_i386.deb
Error in function:
SystemError: E:Sub-process /usr/bin/dpkg returned an err[-] 50% Cleaning up Run[+] 100% Failed
ERROR: Package operation failed
The installation or removal of a software package failed.

installArchives() failed: Preconfiguring packages ...
cp: cannot stat `/usr/share/doc/bandwidthd/bandwidthd.conf': No such file or directory
bandwidthd failed to preconfigure, with exit status 1
Preconfiguring packages ...
cp: cannot stat `/usr/share/doc/bandwidthd/bandwidthd.conf': No such file or directory
bandwidthd failed to preconfigure, with exit status 1
Preconfiguring packages ...
cp: cannot stat `/usr/share/doc/bandwidthd/bandwidthd.conf': No such file or directory
bandwidthd failed to preconfigure, with exit status 1
Selecting previously deselected package bandwidthd.
(Reading database ... 180102 files and directories currently installed.)
Preparing to replace bandwidthd 2.0.1 (using .../bandwidthd_2.0.1+cvs20090917-4.1_i386.deb) ...
/etc/init.d/bandwidthd: 19: Syntax error: "(" unexpected
invoke-rc.d: initscript bandwidthd, action "stop" failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 2
dpkg - trying script from the new package instead ...
/etc/init.d/bandwidthd: 19: Syntax error: "(" unexpected
invoke-rc.d: initscript bandwidthd, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/bandwidthd_2.0.1+cvs20090917-4.1_i386.deb (--unpack):
subprocess new pre-removal script returned error exit status 2
No apport report written because MaxReports is reached already
update-rc.d: warning: /etc/init.d/bandwidthd missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
/etc/init.d/bandwidthd: 19: Syntax error: "(" unexpected
invoke-rc.d: initscript bandwidthd, action "start" failed.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/bandwidthd_2.0.1+cvs20090917-4.1_i386.deb
Error in function:
dpkg: error processing bandwidthd (--configure):
Package is in a very bad inconsistent state - you should
reinstall it before attempting configuration.

:confused:

audiomick
February 26th, 2012, 05:32 PM
LONG post, sorry

There is a button above the posting window marked with a hash
#

click on that and it will give you a set of code tags. Put output like that between those, and it will appear in a nice box with a scroll bar on the side.

If you want to be as fussy as I am ;) , you can add them to your existing post by clicking on the "edit" button on your post, and selecting "go advanced". Select the text you want to have between the tags, then click on the # button.

Antonorsi
February 29th, 2012, 01:07 AM
So, nobody?

matt_symes
February 29th, 2012, 01:20 AM
Hi

Open a terminal and type


sudo touch /usr/share/doc/bandwidthd/bandwidthd.conf

This will create an empty file that may get rid of the first error.

For the second error, type this into a terminal and post back the output using copy and paste.


sed -n '19p' /etc/init.d/bandwidthd

Kind regards

Antonorsi
March 8th, 2012, 02:48 AM
carlosf@CarlosF-HP:~$ sed -n '19p' /etc/init.d/bandwidthd
function checkconfig () {

Antonorsi
March 9th, 2012, 01:26 AM
Anyone?

matt_symes
March 9th, 2012, 08:54 AM
Hi

Press ALT + F2 together. Type


gksudo gedit /etc/init.d/bandwidthd

Scroll down to line 19 and edit it so it looks like this


function checkconfig
{

Save the file.

Kind regards

Antonorsi
March 16th, 2012, 07:32 PM
With ALT+F2 didnt do anything, so I tried from the teminal and this is what happened:



carlosf@CarlosF-HP:~$ gksudo /etc/init.d/bandwidthd

(gksudo:19067): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(gksudo:19067): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(gksudo:19067): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

(gksudo:19067): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

raja.genupula
March 16th, 2012, 07:38 PM
http://askubuntu.com/questions/66356/gdk-gtk-warnings-and-errors-from-the-command-line

EDIT : its always better to start new thread for your own issues .

matt_symes
March 16th, 2012, 08:07 PM
Hi

You need to open the file in gedit.


gksudo gedit /etc/init.d/bandwidthd

Then look for that line and change it.

Kind regards

Antonorsi
March 21st, 2012, 04:12 PM
Thank you all for your time, it worked!

:)