Incomplete package installations from synaptic and software centre

Asked by Fred V. Beek

The disable|enable API is not stable and might change in the future.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 nvidia-kernel-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
#

This is what appears in the little black box when I use the synaptic and ubuntu and it started after the upgrade to 10.04. Some of the programmes are missing stuff like the network manager does not have the check/tick part. It appears that Mr. Walt Tryller # Question 118010 has a similiar problem if not exactly so. Please help. Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
marcobra (Marco Braida)
Solved:
Last query:
Last reply:
Revision history for this message
Sam_ (and-sam) said :
#1

Make sure package related GUIs are closed e.g. Synaptic, Software Center, Update Manager.
Please open a terminal (applications -> accessories -> terminal)
Try:
sudo apt-get -f install
sudo dpkg --configure -a

In case post error messages.

Manual option:
Open Nautilus (file browser) as root.
gksudo nautilus

Go to /var/lib/dpkg/info/
Search for the postinstallation script of the related package nvidia-kernel-common.
e.g.
/var/lib/dpkg/info/nvidia-kernel-common.postinst

Remove it. Close Nautilus.
Go back to terminal and try reinstallation.
sudo apt-get install nvidia-kernel-common

Revision history for this message
Fred V. Beek (fred-dredly-01) said :
#2

Hello Sam thanks for your attention, the following messages appeared

for the first option:

The following packages were automatically installed and are no longer required:
  nvidia-kernel-common
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up nvidia-kernel-common (20051028+1ubuntu7) ...
update-rc.d: warning: /etc/init.d/nvidia-kernel missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | SS KK]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
       update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
  -n: not really
  -f: force

The disable|enable API is not stable and might change in the future.
dpkg: error processing nvidia-kernel-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 nvidia-kernel-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
user@user-ubuntu:~$ sudo dpkg --configure -a
user@user-ubuntu:~$ gksudo nautilus
Initializing nautilus-gdu extension
Nautilus-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error No such file or directory
Please ask your system administrator to enable user sharing.

could not load face 'file:///var/lib/dpkg/info/wireless-tools.preinst': unknown file format

for the second option-manually:
Reading state information... Done
nvidia-kernel-common is already the newest version.
nvidia-kernel-common set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up nvidia-kernel-common (20051028+1ubuntu7) ...
dpkg (subprocess): unable to execute installed post-installation script: Exec format error
dpkg: error processing nvidia-kernel-common (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 nvidia-kernel-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

.I did save the stuff removed from /var/lib/dpkg/info/nvidia-kernel-common.postinst and so put it back. Please do offer any other tips if
possible as I would gladly try them. Thank You Sam.

Revision history for this message
Sam_ (and-sam) said :
#3

Try if a simple clean up works.
sudo apt-get autoremove
sudo apt-get clean
sudo apt-get autoclean

Then try update again in case to get some error outputs.

Revision history for this message
Fred V. Beek (fred-dredly-01) said :
#4

Hello again Sam. I've tried as You've suggested and I'm afraid the result is still the same with the same error messages however I am still hopeful and appreciate all and any assistance. Thank You Sam.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#5

Please try this

Open a Terminal from the menu Applications->Accessories->Terminal

Tip: right click with mouse on the terminal title caption and select the item "Always on Top" doing this you will force the terminal window to stay on top of the other windows and you will find very easy to copy single row from this web page into the terminal...
Something more about using the terminal https://help.ubuntu.com/community/UsingTheTerminal

Then type or better copy and paste a row a time then press enter:
(Tip: select the single row to copy then right click into the terminal and to quick paste click with middle button of mouse )

sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
sudo aptitude clean
sudo aptitude autoclean
sudo apt-get update
sudo dpkg --clear-avail
sudo dpkg --configure -a
sudo aptitude install -f
sudo aptitude update
sudo aptitude dist-upgrade

give your user password when requested, you don't see nothing when you type it, then press enter.

Hope this helps

Revision history for this message
Fred V. Beek (fred-dredly-01) said :
#6

Hello there marcobra (Marco Braida) I have followed Your instruction carefully and regretfully the same error message appeared however, at the end of the process an orange star appeared which subsequently informed about the compilation of a "crash report". I did the requested password confirmation then after several moments an information box appeared announcing
" nvidia kernel common is not an Ubuntu package" at which the whole process seemed to terminate.
 Thank You for the much valued effort marcobra (Marco Braida) and yes these suggestions do sustain hope.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#7

Please try

sudo apt-get purge nvidia-kernel-common

Revision history for this message
Sam_ (and-sam) said :
#8

In case nothing helps:
sudo dpkg --force all --remove

Then try update again.
sudo apt-get update
sudo apt-get -f install

Revision history for this message
Fred V. Beek (fred-dredly-01) said :
#9

Hello there marcobra (Marco Braida) and Sam. Thanks again for Your continuing effort and attention and the following are the results to the suggestions proffered:
1) .sudo apt-get purge nvidia-kernel-common;-the result was the same and is that which is listed below

Reading state information... Done
The following packages will be REMOVED
  nvidia-kernel-common*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 115kB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 222554 files and directories currently installed.)
Removing nvidia-kernel-common ...
/var/lib/dpkg/info/nvidia-kernel-common.prerm: 7: update-modules: not found
dpkg: error processing nvidia-kernel-common (--purge):
 subprocess installed pre-removal script returned error exit status 127
update-rc.d: warning: /etc/init.d/nvidia-kernel missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | SS KK]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
       update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
  -n: not really
  -f: force

The disable|enable API is not stable and might change in the future.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 nvidia-kernel-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

2). sudo dpkg --force all --remove;- this command returned a different response

dpkg: --remove needs at least one package name argument

Type dpkg --help for help about installing and deinstalling packages [*];
Use `dselect' or `aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;
Type dpkg --license|--licence for copyright licence and lack of warranty (GNU GPL) [*].

Options marked [*] produce a lot of output - pipe it through `less' or `more' !

I have read the above help suggestions that returned from 2) and I must admit that it is quite beyond my scope which is why I am grateful for those who do and have the time to exercise their knowledge. Thank You marcobra (Marco Braida) and Thank You Sam.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#10

Try...
sudo dpkg --force all --remove nvidia-kernel-common

Revision history for this message
Fred V. Beek (fred-dredly-01) said :
#11

Hello there marcobra (Marco Braida) there has been a most interesting result to the last suggestion. After the enter command the "terminal' seemed to freeze however the red light continued to flicker for some time then the "update manager" appeared with updates regarding Linux libraries (being three) and one for "Landscape". Upon "install" everything happened rather quickly and before I had quite registered the "update manager" closed itself which means that the update must have been a sucess which I double checked by way of the "Ubuntu Software Centre" and the "Synaptic Package Manager". It was then that I noticed that the "terminal" had disappeared or maybe I accidentally closed it during the double checking. Although greatly relieved at this turnabout anxeity urged me to reopen the "terminal" and the only thing I could get out of it was the last command which is :
" sudo dpkg --force all --remove nvidia-kernel-common".

Do I need to do anything further or should I just wait and see? Thank You yet again marcobra (Marco Braida) these contributions are priceless.

Revision history for this message
Best marcobra (Marco Braida) (marcobra) said :
#12

Please always (sometimes) do this to be sure your system is fully updated/upgraded with no pending packages, so now to be sure of this please redo for the last time:

Open a Terminal from the menu Applications->Accessories->Terminal

Tip: right click with mouse on the terminal title caption and select the item "Always on Top" doing this you will force the terminal window to stay on top of the other windows and you will find very easy to copy single row from this web page into the terminal...
Something more about using the terminal https://help.ubuntu.com/community/UsingTheTerminal

Then type or better copy and paste a row a time then press enter:
(Tip: select the single row to copy then right click into the terminal and to quick paste click with middle button of mouse )

sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
sudo aptitude clean
sudo aptitude autoclean
sudo apt-get update
sudo dpkg --clear-avail
sudo dpkg --configure -a
sudo aptitude install -f
sudo apt-get clean
sudo aptitude update
sudo aptitude dist-upgrade
sudo apt-get autoremove

give your user password when requested, you don't see nothing when you type it, then press enter.

Hope this helps

Revision history for this message
Fred V. Beek (fred-dredly-01) said :
#13

Thanks marcobra (Marco Braida), that solved my question.

Revision history for this message
Fred V. Beek (fred-dredly-01) said :
#14

Hello there marcobra (Marco Braida) I am right now smiling from ear to ear so hard that I fear my head shall fall off. Thank You marcobra (Marco Braida) and not forgetting thank You to Sam for Your contribution too. Plaese do keep on helping people and setting this example which is so obviously beyond repairing confused computers.