Newbie: I just wish I could install broadcom packages to get wifi working

Hello. If someone could help me out I would be very grateful.

I am a beginner to Linux systems, migrating from Mac.
I tried PureOS and love the simplicity and the fact that it does not give my Macbook a non-stop fan workout as Linux Mint is doing. Another thing I really like is how the UI less resembles the Windows look.
It feels minimalistic, smooth and beautiful.

However, I can’t get the wifi to work! I understand I have to download the drivers myself.
I have located which broadcom wifi modem I have and found the necessary files that should work on the arch linux website. I am reading on how to install these packages from the terminal, but can’t get it to work. Let me explain in detail what I am experiencing:

I am trying to install the necessary broadcom support files in the form of .pkg.tar.zst files.
Using pacman -S or pacman -U with the file name there after.

When I enter that command I get the following:

Could not find the database of available applications, run update-command-not-found as root to fix this. Sorry, command-not-found has crashed!

According to this information: https://unix.stackexchange.com/questions/585107/debian-command-not-found-error-local-variable-cnf-referenced-before-assignme

According to one answer I should do a “apt update” to make the problem go away.

When I try to do apt update I get the following

Reading package lists… Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)

Another user suggest the following:

Change permission at

sudo chmod o+r /var/lib/command-not-found/commands.db*

but before that

Check permission variable state information

ls -l /var/lib/command-not-found

total 2588

-rw-r----- 1 root root 2834432 Dec 18 05:25 commands.db
-rw-r----- 1 root root 4712 Dec 18 05:25 commands.db.metadata

It should be:

ls -l /var/lib/command-not-found

When I do this I get : total 0

I have no idea even where to start, as I am not very familiar with these systems yet. So I am asking here and see if there is a soluton.

1 Like

That is definitely an unfortunate and confusing situation for someone not very familiar with the system.

There are a few things that need addressing:

  1. If you are indeed using PureOS, you will not use pacman. pacman is the package manager used by Arch and Arch-based Linux distributions. PureOS is based on Debian (much like Ubuntu and many others). So in general, you will use apt to install packages.
  2. In order to use apt, you need escalated privileges, which you get by using the command with sudo (which stands for Super User Do). So rather than apt update, you need to run sudo apt update.
  3. The command-not-found thing is something that I honestly consider a bug. I think it has a place and a purpose, but not one that I’ve come across, so I would suggest you just ignore any messages you see about it.
  4. If you want to install the proprietary wireless drivers on PureOS, you won’t even be able to use apt to do so. PureOS not only does not provide proprietary software by default, but also doesn’t even make proprietary software available by default. So you have to take a more manual approach if you want to stick with PureOS.

So, with all that said, you have two main options:

  1. Install a different Linux distribution, which is less stringent about free software, i.e. Linux Mint, Ubuntu, or others, and which will either provide the drivers by default or make them easier to obtain.
  2. Install the drivers manually. This isn’t really too difficult, if you have a guide, which I’ll attempt to be.

I’m not sure what model Macbook/wireless chip you have, but these instructions should be good for several models.

Installing Broadcom Drivers Manually

  1. Download the .deb file for the drivers.
    • You can find a .deb file that works for a lot of Broadcom chips here: link
    • Just click whichever link suits you, and you should be prompted to download a .deb file.
  2. Install the package
    • The command to install a package is sudo dpkg -i </path/to/file.deb>
    • Assuming you saved the .deb file to your Downloads folder, you would run sudo dpkg -i ~/Downloads/broadcom-sta-dkms_6.30.223.271-10_all.deb
  3. Restart your computer
7 Likes

Hello William Taylor!

Thank you so much for your support.

I followed your advice installing broadcom drivers manually.
Downloaded the .deb file and followed the instructions.

Everything seems to go well until I get the following message:

dpkg: dependency problems prevent configuration of broadcom-sta-dkms:
broadcom-sta-dkms depends on dkms (>= 2.1.0.0) ;
however: Package dkms is not installed.

Where can I found this package? I tried seraching the debian website without any result and a general websearch which only referred me to a openSUSE website.

Edit: I found what I think is the correct dkms package here:
https://packages.debian.org/buster/dkms

However, upon attempting to install this package using the same command
sudo dpkg -i </path/to/file.deb>

I get the following message:

dpkg: dependency problems prevent configuration of dkms:
dkms depends on dpkg-dev (however it is not installed)
dkms depends on patch (however it is not installed)

I found dpkg-dev, and patch.

When attempting to install the first package I get:

dpkg-dev depends on libdpkg-perl (however it is not installed)

… Is this normal ? I am just running a fresh PureOS 9.0 install.
Seems weird to have to install so many packages manually. But I guess if I keep going on eventually it should reach a stop and just install…

Edit: I finally reached the end with the help of libdpkg-perl

When I install the broadcom package I get this message:

Unpacking…
Setting up…
Loading new boradcom-sta.6.30.223.271 DKMS fies…
Building for 4.19.0-14-amd64

Module build for kernel 4.19.0-14-amd64 was skipped since the kernel headers for this kernel does not seem to be installed.

I am not sure how to read this one? After restarting I still can not find the wifi.

I’ve gone through things in a virtual machine, so here’s what I did to get things to install.

Update 2

Following @Caliga’s suggestion, it does seem like a simple sudo apt install ~/Downloads/broadcom-sta-dkms_6.30.223.271-10_all.deb will work

Update 1

  1. Install PureOS 9 from the download link at pureos.net
  2. At first boot after installation, bring the system fully up-to-date with security patches, etc.
    • sudo apt update
    • sudo apt upgrade
    • Note: you could do this graphically with the “Software” app, but I like being able to see the progress printouts
    • You might also see some message like E: Could not get lock /var/lib/apt/lists/lock. This is generally because the computer is already trying to pull update information in the background for the graphical display, and only one process can be checking for/downloading updates at a time. You can fix this by running sudo systemctl stop packagekit, then the retrying the sudo apt commands
  3. Restart the computer
  4. Since we know we need the dkms package, install it with sudo apt install dkms
  5. Run sudo dpkg -i ~/Downloads/broadcom-sta-dkms_6.30.223.271-10_all.deb, and it should work.
  6. Restart the computer

Original

  1. Install PureOS 9 from the download link at pureos.net
  2. At first boot after installation, bring the system fully up-to-date with security patches, etc.
    • sudo apt update
    • sudo apt upgrade
    • Note: you could do this graphically with the “Software” app, but I like being able to see the progress printouts
    • You might also see some message like E: Could not get lock /var/lib/apt/lists/lock. This is generally because the computer is already trying to pull update information in the background for the graphical display, and only one process can be checking for/downloading updates at a time. You can fix this by running sudo systemctl stop packagekit, then the retrying the sudo apt commands
  3. Restart the computer
  4. Attempt to install the broadcom deb package with sudo dpkg -i ~/Downloads/broadcom-sta-dkms_6.30.223.271-10_all.deb - get the same error you saw.
  5. Attempt to install dkms with sudo apt install dkms - get a different error.
  6. Run sudo apt --fix-broken install
  7. Re-run sudo dpkg -i ~/Downloads/broadcom-sta-dkms_6.30.223.271-10_all.deb
  8. Restart the computer

I don’t actually have Broadcom hardware to verify whether that worked, but I think it should.

If it’s not too much trouble (i.e. won’t lose data), I think I would suggest reinstalling PureOS just to put you back at a clean slate before going through these steps.

2 Likes

It should be simpler to use apt directly to install the package(s) in one command, instead of the fix-broken hack. (That was not possible in the old apt-get days, but now apt can install package files and their dependencies.)
Just be sure that the argument looks like a path, e.g. prepend ./

Huh, somehow after all this time I didn’t know apt worked directly with .deb files, though it makes sense.

Thanks! I followed the advice, made a clean install of PureOS and then followed the instructions. Everything works fine now! I am typing using wifi at the moment.

I really appreciated your support and I look forward to learning more and becoming part of the community.

4 Likes

Hi Folks, I thought I’d add that I installed PuroOS 10 a couple of days ago on an old HP Pavilion. It required proprietary Intel drivers for the wifi. I worked around the problem by adding the relevant Debian non-free repo to my /etc/apt/sources.list.
(deb http://ftp.uk.debian.org/debian/ testing non-free iirc, I’m not near the machine anymore.)

My reason was that as PureOS doesn’t include any non-free software and as PureOS is a close derivative of Debian, then that repo should not conflict with anything in the PureOS repos. To date, that logic seems to have worked, but it’s early days yet…

Any comment on my logic is very welcome (within reason :slight_smile: )

Morgan

I have seen several PureOS devs recommend against adding Debian repos to /etc/apt/sourceslist, which is why I did not suggest that.

I suspect it is indeed fine most of the time, but I think there are situations where it can lead to messy package conflicts. I do think that adding the Debian repo, installing the package, then removing the Debian repo would be fine, though.

Thanks @taylor-williamc, I’ll keep that in mind - I think I’ll leave it active in case of any updates provided on the firmware (unlikely - not the sort of thing that gets much development) and if any conflicts come up, disable the repo then (or find some other resolution). I can only imagine that conflicts might arise in firmware dependencies as the firmware itself should be absent from PuteOS, but conflicts are conflicts…

Hello! I really don’t want to start my own thread but have already asked on this forum elsewhere about any advice for how to get a Thinkpad L540 to work with PureOS, if possible.

Technically, I think the hardware won’t support free software for wifi. I checked H-Node - after finding that the Pure OS Debian link to hardware requirements (via OS Pure’s wiki). I am on Linux Mint but a bit creeped out about how much Ubuntu it uses (isn’t Debian better, for the privacy-minded, c.f.)?

Any thoughts would be much appreciated, thank you!

What wireless card do you have? I think the procedure outlined above should generically work if you just swap out the Broadcom package for whatever package is needed for your chip.

The unfortunate reality is that most computer hardware does not work with free/libre drivers, so if you already have a computer that wasn’t built with free software in mind, you’re generally forced to add some proprietary stuff in order to get it 100% functional.

If you want to stay close to 100% free software, then I’d say stick with PureOS or Debian (without the non-free repo enabled), then manually deal with the pinch points for things like WiFi and graphics cards.

1 Like

Thank you so much for this reply - I am so grateful for your helping me inch my way towards greater free software use.

If you are willing to entertain another question, I am interested in doing a clean install of a new OS - and for a relative n00b (I can only do basic things in terminal, after reading instructions - I so regret not keeping with Linux, which I knew basic commands for in the 90s…), would you recommend PureOS or Debian, until I can invest in Purism hardware?

I think my card is Intel Wireless 7260.

p.s. my gratitude for your reply can perhaps more constructively be phrased as follows: thank you for helping keep the dream of general (personal) computing alive!

1 Like

It’s tough to say, but I would probably lean towards Debian for non-Purism hardware, just since it is a little bit easier to acquire the non-free drivers if/when needed, because you can just add the Debian repo and install from there without worrying about conflicts.

1 Like

Sorry for this late reply, but thank you for your response - which is so valuable as the steps to reaching freedom, as a process, are so hard to come by.

Put another way: there can be a paralysis of not knowing how to move forwards. Sometimes, we just have to try things out, but that can be hard without a more experienced ‘hand’ pointing to a possible path. On that note, thank you for your comment!

1 Like

Hello all,
I will used this post as it is really close to my issue and, as I went through it, I think you need some background about what I did.

I actually have a “old” laptop (Dell M4600 Precision) and I wanted to use it in my workshop just for videos and music. First I installed Kali Linux and it was working rather fine excepted the recurring updates. Then I decided to go fully open-source and I decided to go to PureOS but after the first installation I had issue with the Wifi board.

After a few check related to the proprietary firmware, I thought that it was maybe “too much” to get the internet working and decided, one more time, to switch to another lighter distro Lubuntu. But I also got the same issue with the Wifi board. I was finally thinking that the problem was coming from the hardware and reinstall Kali … and Wifi works!

One more time I decided to make the step towards PureOs and found this thread. I followed all the steps but I have a few issues when I want to install the Broadcom deb package.

When I run sudo dpkg -i ~/Downloads/broadcom-sta-dkms_6.30.223.271-10_all.deb, I have an error message
Building initial module for 5.10.0-9-amd64 Error! Bad return status for module build on kernel: 5.10.0-9-amd64 (x86_64) Consult /var/lib/dkms/broadcom-sta/6.30.223.271/build/make.log for more information. dpkg: error processing package broadcom-sta-dkms (--install): installed broadcom-sta-dkms package post-installation script subprocess returned error exit status 10 Errors were encountered while processing: broadcom-sta-dkms

Afterwards, I was looking to perform the following sudo apt install dkms but another error occured
Reading package lists... Done Building dependency tree... Done Reading state information... Done dkms is already the newest version (2.8.4-3). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Setting up broadcom-sta-dkms (6.30.223.271-10) ... Removing old broadcom-sta-6.30.223.271 DKMS files... Deleting module version: 6.30.223.271 completely from the DKMS tree. Done. Loading new broadcom-sta-6.30.223.271 DKMS files... Building for 5.10.0-9-amd64 Building initial module for 5.10.0-9-amd64 Error! Bad return status for module build on kernel: 5.10.0-9-amd64 (x86_64) Consult /var/lib/dkms/broadcom-sta/6.30.223.271/build/make.log for more information. dpkg: error processing package broadcom-sta-dkms (--configure): installed broadcom-sta-dkms package post-installation script subprocess returned error exit status 10 Errors were encountered while processing: broadcom-sta-dkms E: Sub-process /usr/bin/dpkg returned an error code (1)

Finally, I wanted to give a try with sudo apt --fix-broken install but another error occured Reading package lists... Done Building dependency tree... Done Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up broadcom-sta-dkms (6.30.223.271-10) ... Removing old broadcom-sta-6.30.223.271 DKMS files... Deleting module version: 6.30.223.271 completely from the DKMS tree. Done. Loading new broadcom-sta-6.30.223.271 DKMS files... Building for 5.10.0-9-amd64 Building initial module for 5.10.0-9-amd64 Error! Bad return status for module build on kernel: 5.10.0-9-amd64 (x86_64) Consult /var/lib/dkms/broadcom-sta/6.30.223.271/build/make.log for more informat ion. dpkg: error processing package broadcom-sta-dkms (--configure): installed broadcom-sta-dkms package post-installation script subprocess returne d error exit status 10 Errors were encountered while processing: broadcom-sta-dkms E: Sub-process /usr/bin/dpkg returned an error code (1)

I understand it is rather long to read but I prefer to give some contexts about this. I fully understand the kind of dichotomy between using proprietary firmware on an open-source OS but … I did not choose the hardware :sweat_smile:

If you have any idea for me, I will take it and in the meantime, I wish you all a nice week.

AN

Hmm, I can’t tell for sure, but it kinda looks like there is an issue with the kernel version being used compared with maybe what the Broadcom package can work with.

Since it seems like you don’t have an issue with reinstalling OSes, I would try these steps

  1. Reinstall PureOS
  2. Perform an update with sudo apt update and sudo apt upgrade
  3. Restart the computer
  4. Obtain the Broadcom drivers
    • If you are using PureOS 9 (Amber), then I think the linked Broadcom drivers earlier in this thread should work
    • If you are using PureOS 10 (Byzantium), then you might need to use this link. This is the package for the newer version of Debian on which PureOS 10 is based.
  5. Use sudo apt install </path/to/broadcom.deb> to try installing them.
1 Like

Thanks for your comment. I tried your process and reinstall PureOS and following the steps. Using Pure OS 10, I downloaded the appropriate firmware from your link but I still have an error installing it

sudo apt install ~/broadcom-sta-dkms_6.30.223.271-17_all.deb
[sudo] password for []:
Reading package lists... Error!
E: read, still have 8 to read but none left
E: Internal error, could not locate member control.tar{.zst,.lz4,.gz,.xz,.bz2,.lzma,}
E: Could not read meta data from ~/broadcom-sta-dkms_6.30.223.271-17_all.deb
E: The package lists or status file could not be parsed or opened.

Do you think it would be “easier” to move to Pure OS 9?

Dunno if it makes a difference (been a while since I was on anything debian-based), but try sudo dpkg -i instead of sudo apt install.

Hmm, I am not sure what the issue is. Yes, it might be easier to start with PureOS 9, install things there, and then you can try updating