2

I want to fix the Shellshock issue, and the usual solution is to update Ubuntu.

How can I update only Bash and without having to reboot?

  • 2
    New instances of bash will automatically use the upgraded version. Kill any running instances, if you must. – muru Oct 3 '14 at 12:31
  • 2
    In general you do not need to reboot following an update. The only package that I can think of that requires a reboot is the kernel. Sometimes you need to restart a service, but in that event most packages stop and restart services as part of the install. Sometimes you need to log out and back in or restart programs, but not reboot. – Panther Oct 3 '14 at 12:34
  • 2
    @muru after the bash update the shellshock bug was patched, no need to restart bash, kill bash, or anything. I've tested that on several servers from RHEL to Debian to Ubuntu. – Panther Oct 3 '14 at 12:39
  • Updating Kernel modules can often require a restart of some description too... But even they can be done without a reboot most of the time, it just involves stopping anything that is using them so you can unload the old module and load the new one. Rebooting is often easier and quicker though. – Oli Oct 3 '14 at 12:40
  • 3
    @terdon --- the shellshock bug involves starting a new shell that is reading the (fake) environment. So it is exploitable only on shell start, and this is the reason that when you upgrade, all the new shells started are the upgraded ones, and the bug (at least, this one ;-)) does not manifest itself. – Rmano Oct 3 '14 at 17:15
12

You don't have to restart for the Bash update to take. Just update in the normal way.

sudo apt-get update
sudo apt-get dist-upgrade

If you (for whatever nonsensical reason) need to limit that to Bash, you can:

sudo apt-get update
sudo apt-get install bash

And again, because of the way this exploit is launched (setting an environment variable before starting a new instance of Bash), you don't need to reboot after you do this.

  • I get 0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded. is there a way to specify only bash in the PPA update for apt-get update – Eduard Florinescu Oct 3 '14 at 12:52
  • 2
    For that sort of message, use sudo apt-get dist-upgrade – Panther Oct 3 '14 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.