LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 11-17-2004, 04:10 PM   #1
amon
Member
 
Registered: May 2004
Location: UK
Distribution: Debian, Ubantu, CentOS
Posts: 146

Rep: Reputation: 17
apt-get problem - need top force remove an application


I am running an installation of Libranet which i have upgraded with apt-get to the equivalent of Debian Sarge. after doing an upgrade and makeing some changes the alsa audio stopped working properly. in my inexperiance i attempted to use the setup scripts provided by adminmenu (application provided by libranet). after attempting to apt-get alsa and various other things (i can't remember exactly what ive done after 3 hours of no luck) i have managed to have a copy of alsa-modules installed that i can't remove, and without reomving this programme i can't make any changes.

the installed program is one of the libranet specific programmes. i have also got the problem that this is stopping the installation of annother application that is broken.

when i run apt-get the error i get is:
root@amon1:/home/amon# apt-get -f install
Reading Package Lists... Done
Building Dependency Tree... Done
Correcting dependencies... Done
The following extra packages will be installed:
kudzu kudzu-vesa libranet-upgrade pciutils
The following packages will be REMOVED:
alsa-modules-2.4.21
The following NEW packages will be installed:
kudzu kudzu-vesa libranet-upgrade pciutils
0 upgraded, 4 newly installed, 1 to remove and 5 not upgraded.
2 not fully installed or removed.
Need to get 0B/468kB of archives.
After unpacking 609kB disk space will be freed.
Do you want to continue? [Y/n] y
Media Change: Please insert the disc labeled
'Libranet GNU/Linux 2.8.1 CD2'
in the drive '/cdrom/' and press enter

(Reading database ... 137510 files and directories currently installed.)
Removing alsa-modules-2.4.21 ...
invoke-rc.d: unknown initscript, /etc/init.d/alsa not found.
dpkg: error processing alsa-modules-2.4.21 (--remove):
subprocess post-removal script returned error exit status 100
Errors were encountered while processing:
alsa-modules-2.4.21
E: Sub-process /usr/bin/dpkg returned an error code (1)


is there a way of removing the entry from the apt-get database as i have physicaly deleated the files listed for alsa-modules using rm as su.
 
Old 11-17-2004, 04:32 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
The thing to try first:
dpkg --purge alsa-modules-2.4.21

If that doesn't work, move to way 2.

Way #2:
ok, there goes something wrong with the
/var/lib/dpkg/info/alsa-modules-2.4.21.postrm
file (no, don't remove it!), probably because it wasn't prepared that the files are missing.

If that package is from libranet I don't know the exact contents, but it probably has
some lines like:
Code:
if [ "$1" = "remove" ]; then
        if [ $(uname -r) = "2.4.21" ]; then
                invoke-rc.d alsa stop
        fi
fi
If so, replace them with :
Code:
if [ "$1" = "remove" ]; then
        if [ $(uname -r) = "2.4.21" ]; then
#                invoke-rc.d alsa stop
             true
        fi
fi
(Comment out the invoke-rc.d line and add the line "true").

Now run
apt-get -f install
again and see if it works.


And what comes to deleting files, don't. Use apt-get and dpkg to manage your files in other places than /home, /usr/local and /etc (let the package mangager to keep record of files in /etc too, to some extent).
 
Old 11-17-2004, 04:33 PM   #3
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Ah, and a way #3:
(that might also work)
Code:
touch /etc/init.d/alsa
chmod +x /etc/init.d/alsa
apt-get -f install
 
Old 11-17-2004, 06:07 PM   #4
amon
Member
 
Registered: May 2004
Location: UK
Distribution: Debian, Ubantu, CentOS
Posts: 146

Original Poster
Rep: Reputation: 17
method 1 was unsuccessful.

however method 2 worked strait off and the file was easy to find and the edit was easy, exactly as stated above. thanks very much.
 
Old 10-22-2010, 07:02 AM   #5
jamslug
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
Same problem with mysql-cluster-server in ubuntu 10.10

I read your post and you gave me inspiration:

For me it was this file: /var/lib/dpkg/info/mysql-cluster-server-5.1.prerm

And I edited as this:

#!/bin/sh
set -e
# Automatically added by dh_installinit
if [ -x "/etc/init.d/mysql" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
true
#invoke-rc.d mysql stop || exit $?
#else
#/etc/init.d/mysql stop || exit $?
fi
fi
# End automatically added section

Works perfect ;-)

Thanks a lot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add/Remove Application Problem Coldfish Fedora 2 09-10-2005 06:43 AM
how to remove top and front cover of E4500 veeraalin Solaris / OpenSolaris 2 07-28-2005 02:27 AM
Force an application to run only for my user purefan General 1 04-12-2005 09:30 AM
HELP with apt-getHow come when I tried to use apt-get to remove a package to regain redss Linux - Newbie 1 08-22-2004 11:59 PM
apt-get problem, gonna remove 161 packets???? quzheng Linux - Software 0 07-19-2004 01:57 AM


All times are GMT -5. The time now is 10:53 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration