How to restore accidentally deleted /etc/bash.bashrc, without reinstalling Ubuntu? [duplicate]

Either restore that single file from bash's deb package:

$ apt-get download bash
$ dpkg-deb --fsys-tarfile bash_*.deb > /tmp/bash_pkg.tar
$ tar -Oxf /tmp/bash_pkg.tar ./etc/bash.bashrc | sudo tee /etc/bash.bashrc

Or restore all missing files of bash:

sudo apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall bash

Read more


There is also a file which might be helpful to you:

/usr/share/doc/adduser/examples/adduser.local.conf.examples/bash.bashrc

however I believe that this file is belong to adduser package.