I can not remove broken package. Use the following command: sudo apt-get -f installbut I get the following response:
Preparing to unpack .../nodejs_0.10.28-1chl1~trusty1_amd64.deb ...
Unpacking nodejs (0.10.28-1chl1~trusty1) over (0.10.25~dfsg2-2ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_0.10.28-1chl1~trusty1_amd64.deb (--unpack): trying to overwrite '/usr/share/man/man1/node.1.gz', which is also in package nodejs-legacy 0.10.25~dfsg2-2ubuntu1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for man-db (2.6.7.1-1) ...
Errors were encountered while processing: /var/cache/apt/archives/nodejs_0.10.28-1chl1~trusty1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)I tried various commands like
2015 sudo apt-get clean 2020 sudo dpkg --configure -a 2023 sudo apt-get autoremove 2034 sudo apt-get upgrade && sudo apt-get -f installBut I did not get any result. I can not install synaptic. Any ideas how can I remove the broken package ?
113 Answers
run this command to remove broken packages in ubuntu.
sudo dpkg --remove --force-remove-reinstreq package_name after removing package update your system with command
sudo apt-get update
restart system after successfully updation.
6This fixed my problem:
sudo dpkg -i --force-overwrite /var/cache/apt/archives/nodejs_0.10.28-1chl1~trusty1_amd64.deb 1 I've found that:
sudo dpkg --remove --force-remove-reinstreq <packagename>Works best. If it gives you an error that it won't remove a package because it is depended on by another package, remove that other package as well. You'll have to repeat this step several times and then reinstall your deleted packages.
The force-remove-reinstreq is THE "nuclear option" of deleting a package. It only fails if there is another package depending on the one you're about to delete -- Again, in that case, deleted the depending package too.
Open your terminal and use following command
sudo dpkg --purge nodejs-legacy
sudo apt-get install -fIt should solve your problem.
NOTE: The following command will remove the installation and removal scripts including the list files. It won't remove the package, nor it will fix anything, it will just make
dpkgforget about the error message.
rm /var/lib/dpkg/info/<package_name>.*example:
rm /var/lib/dpkg/info/elasticsearch.*
nothing of the above worked for me. eventually I edited the /var/lib/dpkg/status file and removed the packages from there.
Tough I would not advice to do this, just if anything else fails...
1If you have a broken dependency (which I have encountered with openjdk), you will want to purge the package and force it to skip over dependency problems:
sudo dpkg -P --force-depends package_nameI found the answer on another forum
Open your terminal , and paste these line after line
sudo rm -rf /var/cache/apt/archives/nodejs_0.10.28-1chl1~trusty1_amd64.deb
sudo apt-get autoclean
sudo apt-get update
sudo apt-get upgradethen try again
Here's one:
update your package list like this
sudo apt-get updatethen cleanup any partial packages
sudo apt-get autocleanNow clean the apt cache
sudo apt-get cleanNow remove any unnecessary dependancies
sudo apt-get autoremovefrom the command above, you can identify any broken packages and forcefully remove it like this
sudo dpkg --remove --force-remove-reinstreq package_nameFinally mopup any other packages with dependacies
sudo apt-get -f install Tell me how it goes.
4The same error repeats If we do apt-get clean and apt-get -f install unless we remove the junk data from /var/lib/dpkg/status file in Ubuntu.
Suppose we need to remove apache broken package. Initially we have to open the status file and search for the package apache. Remove the entire package description and save the status file. Then try using apt-get -f install and apt-get clean.
None of the above worked for me
I used sudo aptitude.
It found the error immediately and offered options. You select and it fixes it.
1- query all the packages that are installed today or yesterday
awk -v foo=$(date '+%Y-%m-%d') -v bar=$(date -d "yesterday" '+%Y-%m-%d') '($1==foo || $1==bar) && $3~/^install$/ { print $4 }' /var/log/dpkg.log wine-qqintl:i386 caused the problem, so I remove the package
sudo dpkg -r wine-qqintl:i386done.
I had a problem with broken kodi package. I opened synaptic package manager and used the "broken" filter to locate the package and marked it for complete removal. It worked like a champ.