I deleted the dpkg binary file using sudo rm /usr/bin/dpkg
now I am encountering problems you can assume what kind. Later I found out that it was a very impotent file. I am a new ubuntu user in the learning stage. I did not know what I was doing. I refered to this Accidentally deleted /usr/bin/dpkg post but when I tried the solution I get
Could not exec dpkg!
E: Sub-process /usr/bin/dpkg returned an error code (100)
I was able to fix this when I changed the file permissions
sudo chmod a+x /usr/bin/dpkg
Now when running
sudo apt-get install --reinstall dpkg
I get a number of errors including
`File "/usr/lib/update-notifier/package-data-downloader", line 29, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
`dpkg: error processing package update-notifier-common (--configure):
installed update-notifier-common package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of update-notifier:
update-notifier depends on update-notifier-common (= 3.192.30.17); however:
Package update-notifier-common is not configured yet.
dpkg: error processing package update-notifier (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of update-manager:
update-manager depends on update-notifier; however:
Package update-notifier is not configured yet.
dpkg: error processing package update-manager (--configure):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
update-notifier-common
update-notifier
update-manager
And at last
E: Sub-process /usr/bin/dpkg returned an error code (1)
Please help