Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save niftylettuce/5619c2be9906bcbd893e1e1a25b9d795 to your computer and use it in GitHub Desktop.
Save niftylettuce/5619c2be9906bcbd893e1e1a25b9d795 to your computer and use it in GitHub Desktop.
How to Enable Wi-Fi on MacBook, Mac Mini, MacBook Air for Ubuntu/Linux/Debian/Mint/Mate OS ---- If you liked this, check out my email forwarding service at https://forwardemail.net 🎉 🎉 🎉

How to Enable Wi-Fi on MacBook, Mac Mini, MacBook Air for Ubuntu/Linux OS

By default older Mac computer models have driver issues with the Broadcom Wi-Fi chip. Most instructions online (such as this one from the official Ubuntu docs @ https://help.ubuntu.com/community/Macmini5-1/Precise) suggest to use sudo apt-get and install these packages from the PPA.

BUT you don't have Internet so you can't use apt-get! Instead you can use a different computer to download the packages, then transfer them over.

In the instructions below, you will need to replace sid in the download URL's with the proper version of Debian your version of Ubuntu/Linux is using. To find which version you should use, you can view the chart at https://askubuntu.com/questions/445487/what-debian-version-are-the-different-ubuntu-versions-based-on#445496. If you're using jessie for example, then replace all sid with jessie in the links below.

  1. Download b43-fwcutter @ https://packages.debian.org/sid/b43-fwcutter (replace "sid" in the URL as needed -- scroll down to "Download" section and choose based off your architecture, and then select a mirror/FTP link to download from on the next page that appears).
  2. Download firmware-b43-installer @ https://packages.debian.org/sid/firmware-b43-installer (repeat same note as above)
  3. Download webfs @ https://packages.debian.org/sid/webfs (repeat same note as above)
  4. Download http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2 (e.g. using wget http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2)
  5. Save these downloaded files to flash storage and then insert flash storage into your Ubuntu/Linux machine.
  6. Copy the files from the flash storage to your Ubuntu/Linux machine's desktop.
  7. Open a terminal and run the command echo '127.0.0.1 www.lwfinger.com' | sudo tee --append /etc/hosts
  8. Run the command sudo dpkg -i ~/Desktop/webfs.deb (replace webfs.deb with the webfs deb file name)
  9. Run the command sudo mkdir -p /var/www/b43-firmware
  10. Run the command sudo mv ~/Desktop/broadcom-wl-5.100.138.tar.bz2 /var/www/b43-firmware/
  11. Run the command sudo sed -i -e 's/web_root="\/var\/www\/html"/web_root="\/var\/www"/' /etc/webfsd.conf
  12. Run the command sudo sed -i -e 's/web_port=""/web_port="80"/' /etc/webfsd.conf
  13. Restart the web server sudo /etc/init.d/webfs restart (you may need to use sudo systemctl restart webfs if your system uses systemd)
  14. Run the command sudo dpkg -i ~/Desktop/b43-fwcutter.deb (replace b43-fwcutter.deb with the b43-fwcutter deb file name)
  15. Run the command sudo dpkg -i ~/Desktop/firmware-b43-installer.deb (replace firmware-b43-installer.deb with the firmware-b43-installer deb file name)
  16. Run the command echo 'blacklist ndiswrapper' | sudo tee --append /etc/modprobe.d/blacklist.conf
  17. Run the command echo 'SUSPEND_MODULES="b43 bcma"' | sudo tee ---append /etc/pm/config.d/modules
  18. Run sudo reboot and then check if you can connect to Wi-Fi.
  19. See https://help.ubuntu.com/community/MacBookPro8-2#Wireless for other instructions, such as enabling Sensors. Also see https://askubuntu.com/questions/334561/problems-with-broadcom-bcm4311-wireless-card-on-hp-pavillion-dv6000#667832 for reference.
  20. Remove webfs and the temp dir by typing sudo apt-get remove -y webfs and sudo rm -rf /var/www/b43-firmware/ on your Ubuntu/Linux machine afterwards.
@anurag345
Copy link

anurag345 commented Mar 19, 2019

No working on macbook air
Did everything as u said
But not working on kali linux
nothing changes after restarting

@haohello
Copy link

haohello commented Jul 25, 2019

this solution doesn't work for me, I found another simpler solution to this problem. Just go to this page to download and install the driver, by the way, my mac mini is late 2014 and the OS is Debian 10 (buster).

@dmbois
Copy link

dmbois commented Jul 30, 2019

I created a GitHub account just now for the express purpose of returning here to say: holy crap, it worked! thankyouthankyouthankyou

inherited my mom's mid-2009 15" MB Pro when she passed a few years ago. It's still a super beefy rig (4g dual core half gig storage -- very well suited for creative content production), excepting of course for the Cupertino Colossus' insistence upon abandoning their own still-working hardware. I was determined to return it to a state of usefulness. Ubuntu was the obvious choice. I'd tried it several years ago and really liked it. (fwiw, non-tech me had ZERO problems setting it up as a dual-boot in the PC / Windows environment on a Dell I'd had at the time, although that ease probably had a lot to do with having had a cooperative CD burner at the time).

Again -- I am not a super tech-savvy guy. Neither of our Apple "super drives" (hows THAT for cynical branding, btw?) work reliably (i.e. no burn-to-DVD), so the OS installation itself required my patience and LOTS of persistence.

And then I ran into the Broadcom / wifi issue ... good times hahaha

more persistence applied ... but even though my deep dive into a discomfort zone found me working through these steps VERY slowly / cautiously, at the culmination of the last step, first attempt, the clouds parted, a chorus of angels began singing, and blink! -- wifi visible and functional.

Super relieved, and extremely grateful. I have what's functionally a brand new decade old laptop. And it's again a nimble screamer of a rig. Thank you again! -dave

@niftylettuce
Copy link
Author

@dmbois 😄

@madmedicnl
Copy link

Thank you so much for this

@bmccann36
Copy link

Thanks!
This worked for me.
One thing I had to do was run chmod -R 777 /var/www because I was getting a 403 access denied error at step 15. Probably would be better to allow just read access to the specific file that we moved there. Might be worth adding to the instructions if this is an issue a lot of people will run into.

@hocuspocuss
Copy link

hocuspocuss commented Nov 3, 2019

I tried and when I get to the line where "... webfsd.conf..." (line 11 and 12), it does not work. This file does not exist in the \etc folder....

@kitchen
Copy link

kitchen commented May 24, 2020

Thanks!
This worked for me.
One thing I had to do was run chmod -R 777 /var/www because I was getting a 403 access denied error at step 15. Probably would be better to allow just read access to the specific file that we moved there. Might be worth adding to the instructions if this is an issue a lot of people will run into.

please do not ever use chmod 777 unless you absolutely know what you're doing. You almost certainly could have simply done chmod -R +r /var/www (which grants read permissions recursively to everything under /var/www) instead and not have compromised the security of your system.

@mdeterink
Copy link

mdeterink commented Jun 9, 2020

Dear @niftylettuce, thank you very much for your 20 steps above. I have a 2006 iMac 6,1 and I managed to successfully install Lubuntu 20.04 on it using this thread: https://mesom.de/efi32boot/index.html
Next, I follow your steps above, since I suspect that my iMac ethernet adapter is broken. It all goes well until step 15. Here it goes wrong. See the error message below:

mdeterink@iMac:~$ sudo dpkg -i ~/Desktop/firmware-b43-installer_019-5_all.deb (Reading database ... 228698 files and directories currently installed.) Preparing to unpack .../firmware-b43-installer_019-5_all.deb ... Unpacking firmware-b43-installer (1:019-5) over (1:019-5) ... Setting up firmware-b43-installer (1:019-5) ... No chroot environment found. Starting normal installation --2020-06-09 20:17:30-- https://www.lwfinger.com/b43-firmware/broadcom-wl-6.30.163.46.tar.bz2 Resolving www.lwfinger.com (www.lwfinger.com)... 127.0.0.1 Connecting to www.lwfinger.com (www.lwfinger.com)|127.0.0.1|:443... failed: Connection refused. /var/lib/dpkg/info/firmware-b43-installer.postinst: Some problem occurred during the firmware download. Please check your internet connection. dpkg: error processing package firmware-b43-installer (--install): installed firmware-b43-installer package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: firmware-b43-installer mdeterink@iMac:~$

I do not know what to do. I checked my '/etc/hosts' file and it includes the line '127.0.0.1 www.lwfinger.com'. I would be very greatful if anyone can help me. Lubuntu is working very nicely on my old iMac, but without network it becomes impossible.
Thanks, Marco

@mdeterink
Copy link

Dear @niftylettuce, I just found the solution myself, I followed these steps and got my Wifi working :)
https://askubuntu.com/questions/730799/installing-firmware-b43-installer-offline
Thank you for your information here, it put me on the right track!

@niftylettuce
Copy link
Author

Glad to hear. There's a link to donate on my new website if you want to support my work:

https://forwardemail.net

@lilhacker
Copy link

Thank you so much for this!! Worked like a charm. I have a mid-2011 Mac Mini on which I had to install Linux post HDD failure. So this helped a lot.

@niftylettuce
Copy link
Author

No problem

@hopemoran
Copy link

@hocuspocuss were you able to find out the issue that caused there to be no webfsd.conf file? I am having the same issue at step 11.

@ip-rookie
Copy link

Hi all,
i got to step 13 , I used ¨sudo systemctl restart webfs¨and got the following message ¨Job for webfs.service failed because the control process exited with error code. See ´systemctl status webfs.service´and ´journalctl -xe´¨

when running those commands I got this
buntu@ubuntu:~/Desktop$ systemctl status webfs.service
● webfs.service - LSB: Webfs simple HTTP server
Loaded: loaded (/etc/init.d/webfs; generated)
Active: failed (Result: exit-code) since Mon 2020-10-05 22:18:05 UTC; 2min 41s ago
Docs: man:systemd-sysv-generator(8)
Process: 6986 ExecStart=/etc/init.d/webfs start (code=exited, status=2)
Tasks: 1 (limit: 4538)
Memory: 2.4M
CGroup: /system.slice/webfs.service
└─6648 /usr/bin/webfsd -k /var/run/webfs/webfsd.pid -r /var/www/html -u www-data -g www-data

Oct 05 22:18:05 ubuntu systemd[1]: Starting LSB: Webfs simple HTTP server...
Oct 05 22:18:05 ubuntu webfs[6986]: /etc/init.d/webfs: 48: /etc/webfsd.conf: Syntax error: Unterminated quoted string
Oct 05 22:18:05 ubuntu systemd[1]: webfs.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Oct 05 22:18:05 ubuntu systemd[1]: webfs.service: Failed with result 'exit-code'.
Oct 05 22:18:05 ubuntu systemd[1]: Failed to start LSB: Webfs simple HTTP server.
ubuntu@ubuntu:~/Desktop$ journalctl -xe
Oct 05 22:18:05 ubuntu systemd[1]: webfs.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support

-- An ExecStart= process belonging to unit webfs.service has exited.

-- The process' exit code is 'exited' and its exit status is 2.
Oct 05 22:18:05 ubuntu systemd[1]: webfs.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support

-- The unit webfs.service has entered the 'failed' state with result 'exit-code'.
Oct 05 22:18:05 ubuntu systemd[1]: Failed to start LSB: Webfs simple HTTP server.
-- Subject: A start job for unit webfs.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support

-- A start job for unit webfs.service has finished with a failure.

-- The job identifier is 2724 and the job result is failed.
Oct 05 22:18:05 ubuntu sudo[6983]: pam_unix(sudo:session): session closed for user root

I am very new to this and have no idea what to do. if anyone can help i would be very grateful :)

@dakos-abyss
Copy link

Hello, installing Debian 10 on my 2011 Mac Mini (Mac Mini 5.2), and I've run into an issue on Step 15:

sudo dpkg -i ~/Desktop/firmware-b43-installer_019-6_all.deb
(Reading database ... 257324 files and directories currently installed.)
Preparing to unpack .../firmware-b43-installer_019-6_all.deb ...
Unpacking firmware-b43-installer (1:019-6) over (1:019-6) ...
dpkg: dependancy problems prevent configuration of firmware-b43-installer:
 firmware-b43-installer depends on wget; however;
  Package wget is not installed.

dpkg: error processing package firmware-b43-installer (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 firmware-b434-installer

@zfortier
Copy link

zfortier commented Jan 6, 2021

@dakos-abyss

Hello, installing Debian 10 on my 2011 Mac Mini (Mac Mini 5.2), and I've run into an issue on Step 15:
[...]

The error is telling you what you need to do...

firmware-b43-installer depends on wget; however;
Package wget is not installed.

I think you should try installing wget first....

@zfortier
Copy link

zfortier commented Jan 6, 2021

This can be done much easier by using netcat to serve the file. That way you don't need any of the web server steps.

  1. Download all the files (b43-fwcutter, firmware-b43-installer and http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2)
  2. Open a terminal and run these commands:
cp /etc/hosts /etc/hosts.bak
echo 127.0.0.1 www.lwfinger.com >> /etc/hosts
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(wc -c <broadcom-wl-5.100.138.tar.bz2)\r\n\r\n"; cat broadcom-wl-5.100.138.tar.bz2; } | nc -l -p  80 &
dpkg -i ~/Desktop/b43-fwcutter.deb
dpkg -i ~/Desktop/firmware-b43-installer.deb
cat /etc/hosts.bak > /etc/hosts

Worked for me 💯

@aditya9710
Copy link

aditya9710 commented Mar 5, 2021

Hi, installed Ubuntu 20.04 on my Macbook Pro 2019. I'm facing some issues in the procedure. After package warnings from dpkg, it displays this:

Preparing to unpack .../webfs_1.21+ds1-12+b1_amd64.deb ...
Unpacking webfs (1.21+ds1-12+b1) over (1.21+ds1-12+b1) ...
Setting up webfs (1.21+ds1-12+b1) ...
dpkg: error processing package webfs (--install):
 installed webfs package post-installation script subprocess returned error exit status 10
Processing triggers for systemd (245.4-4ubuntu3.4) ...
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 webfs

Would appreciate any help in resolving the issue.

@krimlon
Copy link

krimlon commented Apr 3, 2021

Hi, installed Ubuntu 20.04 on my Macbook Pro 2019. I'm facing some issues in the procedure. After package warnings from dpkg, it displays this:

Preparing to unpack .../webfs_1.21+ds1-12+b1_amd64.deb ...
Unpacking webfs (1.21+ds1-12+b1) over (1.21+ds1-12+b1) ...
Setting up webfs (1.21+ds1-12+b1) ...
dpkg: error processing package webfs (--install):
 installed webfs package post-installation script subprocess returned error exit status 10
Processing triggers for systemd (245.4-4ubuntu3.4) ...
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
 webfs

Would appreciate any help in resolving the issue.

ya I'm having the same issue. hopefully someone can assist with this.

@orbanbalage
Copy link

@ashutoshmjain
Copy link

I am using Air 2012 . I installed Debian (full DVD on USB) wiping off Catalina completely. Everything worked great except for the WiFi. Getting WiFi needed some research but it is as simple as downloading two files ... Details on the page here https://wireless.wiki.kernel.org/en/users/Drivers/brcm80211

Most of the information on internet is quite outdated .. Now we have fully open sourced drivers for most of the older Broad-com WiFi cards. Just download Linux firmware from the link https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git ; expand the archive on some internet connected machine . Copy brcm/bcm43xx-0.fw and brcm/bcm43xx_hdr-0.fw to /lib/firmware/brcm (or wherever firmware is normally installed on your system) via a usb .. and reboot

@petercorke
Copy link

Hi, nice procedure but like some others I got stuck at step 15. I'm working with Ubuntu 22.04, and dpkg is doing an https (not http) request to the webserver which it can't handle, it gives a 443 error. Not sure if there's an easy way around this, webfsd has no support for https and I can't see anyway to make dpkg to use http instead of https. Also, for 22.04 the version number used at step 4 is different.

@ghbry
Copy link

ghbry commented May 6, 2023

I installed the oem version of Xubuntu on my Macbook Air (2016). It found the wifi connection during the setup without problems. After that i changed the oem to a custom version by dblclicking the shortcut on the desktop for redistribution to users. Restarted and wifi works. Hope it will help others.

@cajsamra
Copy link

I gave this a try when I discovered my entire Broadcom device was not working for my new ubuntu install - both for wired and wireless were not working. It failed at step #8 because of missing dependencies. After trying to resolve them briefly, I decided to re-install from scratch. This time, I had a wired connection, and I checked all the boxes for third party software and updates. This ensured that all required packages would be downloaded. That worked. After the install, the wired connection worked but the WiFi did not. I found a fix for that here: https://www.linuxfordevices.com/tutorials/ubuntu/no-wi-fi-adapter-found-error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment