So, I overwrote /bin/bash with a stupid bash script by accident. My previous question can be found below. It was recommended that I create a new one to deal with a problem that arose. To recap, I was able to use the GUI to change my default terminal to dash, where I can run commands. Now, I am attempting to reinstall bash so that I can change my default terminal back. As previously stated, I'm running apt-get --reinstall install bash, which should reinstall it. However, it returns an error:
reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
bash-completion
Suggested packages:
bash-doc
The following packages will be upgraded:
bash bash-completion
2 upgraded, 0 newly installed, 0 to remove and 2128 not upgraded.
2 not fully installed or removed.
Need to get 0 B/1,605 kB of archives.
After this operation, 673 kB of additional disk space will be used.
Do you want to continue? [Y/n] (Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 307792 files and directories currently installed.)
Preparing to unpack .../archives/bash_4.4-5_amd64.deb ...
dpkg (subprocess): unable to execute old pre-removal script (/var/lib/dpkg/info/bash.prerm): No such file or directory
dpkg: warning: subprocess old pre-removal script returned error exit status 2
dpkg: trying script from the new package instead ...
dpkg (subprocess): unable to execute new pre-removal script (/var/lib/dpkg/tmp.ci/prerm): No such file or directory
dpkg: error processing archive /var/cache/apt/archives/bash_4.4-5_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 2
dpkg (subprocess): unable to execute installed post-installation script (/var/lib/dpkg/info/bash.postinst): No such file or directory
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/bash_4.4-5_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Also, dpkg --configure bash says that it had and error processing the package, and that bash is "in a very bad inconsistent state; you should reinstall it before attempting configuration."
The distribution I an running is Kali 2.2 rolling, and I already know I'm gonna get a lot of hate for this one because if anything, overwriting bash is a mistake.
New Post, as recommeded by @Philippos. Link to old post is here