Unable to install bluetooth driver

ENG:
Hi, i have a usb bluetooth adapter (Hommie BT-501) and looks like drivers are windows only, but on amazon i found some people saying that they got it working on linux because the chipset is RTL8761BUV and it can be found in the asus BT500 driver. The problem is that when i try to install the driver i get this error (unplugging the adapter before installing doesn’t fix the problem):

ITA:
Ciao, ho un adattatore bluetooth usb (Hommie BT-501) e il produttore dichiara che funzioni solo con windows, ma guardando le domande su amazon ho visto che a molte persone funziona senza problemi e uno nello specifico spiega che il chipset è il RTL8761BUV e che il driver per linux è contenuto nel BT500 di asus. Il problema è che quando provo a installarlo mi da questo errore e non so come procedere (staccare la chiavetta non risolve il problema):

[steve@manjaro-fisso 20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202]$ sudo make install INTERFACE=usb
mkdir -p /lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth
Start Realtek Bluetooth USB driver installation
mkdir -p /lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_fw to /lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_fw /lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_config /lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_config /lib/firmware
make -C usb install
make[1]: ingresso nella directory «/home/steve/Scrivania/20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202/20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202/usb»
rmmod btusb
rmmod: ERROR: Module btusb is not currently loaded
make[1]: [Makefile:7: install] Errore 1 (ignorato)
mv /lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb.ko /lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb_bak
mv: impossibile eseguire stat di '/lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb.ko': File o directory non esistente
make[1]: [Makefile:8: install] Errore 1 (ignorato)
rmmod rtk_btusb
rmmod: ERROR: Module rtk_btusb is not currently loaded
make[1]: [Makefile:9: install] Errore 1 (ignorato)
make -C ./bluetooth_usb_driver
make[2]: ingresso nella directory «/home/steve/Scrivania/20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202/20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202/usb/bluetooth_usb_driver»
make -C /lib/modules/5.9.16-1-MANJARO/build M=/home/steve/Scrivania/20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202/20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202/usb/bluetooth_usb_driver modules
make[3]: ingresso nella directory «/usr/lib/modules/5.9.16-1-MANJARO/build»
make[3]: ***  Nessuna regola per generare l'obiettivo «modules».  Arresto.
make[3]: uscita dalla directory «/usr/lib/modules/5.9.16-1-MANJARO/build»
make[2]: *** [Makefile:10: all] Errore 2
make[2]: uscita dalla directory «/home/steve/Scrivania/20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202/20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202/usb/bluetooth_usb_driver»
make[1]: *** [Makefile:10: install] Errore 2
make[1]: uscita dalla directory «/home/steve/Scrivania/20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202/20200806_LINUX_BT_DRIVER_RTL8761B_COEX_v0202/usb»
make: *** [Makefile:28: install] Errore 2

How am i supposed to install it? Thank you for helping me and sorry for my bad english, i’m not a native speaker :slight_smile:

Try rtl8761usb in the AUR (Arch User Repository).

I still get an error while installing it:

mkdir -p ./lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth
Start Realtek Bluetooth USB driver installation
mkdir -p ./lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_fw to ./lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_fw ./lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_config ./lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_config ./lib/firmware
make -C usb install
make[1]: attenzione: jobserver non disponibile, viene usato -j1. Aggiungere «+» alla regola make superiore.
make[1]: ingresso nella directory «/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb»
rmmod btusb
rmmod: ERROR: could not remove 'btusb': Operation not permitted
rmmod: ERROR: could not remove module btusb: Operation not permitted
make[1]: [Makefile:7: install] Errore 1 (ignorato)
mv ../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb.ko ../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb_bak
mv: impossibile eseguire stat di '../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb.ko': File o directory non esistente
make[1]: [Makefile:8: install] Errore 1 (ignorato)
rmmod rtk_btusb
rmmod: ERROR: Module rtk_btusb is not currently loaded
make[1]: [Makefile:9: install] Errore 1 (ignorato)
make -C ./bluetooth_usb_driver
make[2]: ingresso nella directory «/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver»
make -C /lib/modules/5.9.16-1-MANJARO/build M=/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver modules
make[3]: ingresso nella directory «/usr/lib/modules/5.9.16-1-MANJARO/build»
make[3]: ***  Nessuna regola per generare l'obiettivo «modules».  Arresto.
make[3]: uscita dalla directory «/usr/lib/modules/5.9.16-1-MANJARO/build»
make[2]: *** [Makefile:10: all] Errore 2
make[2]: uscita dalla directory «/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver»
make[1]: *** [Makefile:10: install] Errore 2
make[1]: uscita dalla directory «/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb»
make: *** [Makefile:28: install] Errore 2
==> ERRORE: Si è verificato un errore in package().
    L'operazione sta per essere interrotta...

From the looks of that
I don’t think you used the PKGBUILD from AUR to compile and install

AUR (en) - rtl8761usb

I’m using the one that i found in the AUR, maybe i’m doing something wrong or i need to enable some sort of module. Here is my log:

[steve@manjaro-fisso Programmi]$ git clone https://aur.archlinux.org/rtl8761usb.git
Clone in 'rtl8761usb' in corso...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 10 (delta 0), reused 10 (delta 0), pack-reused 0
Decompressione degli oggetti in corso: 100% (10/10), 2.39 KiB | 2.39 MiB/s, fatto.
[steve@manjaro-fisso Programmi]$ cd rtl8761usb/
[steve@manjaro-fisso rtl8761usb]$ makepkg -i
==> Creazione del pacchetto: rtl8761usb 20201202-2 (dom 21 feb 2021, 17:19:13)
==> Controllo delle dipendenze durante l'avvio in corso...
==> Controllo delle dipendenze durante la compilazione in corso...
==> Download dei sorgenti in corso...
  -> Download di 20201202_mpow_BH456A_driver+for+Linux.7z in corso...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2158k  100 2158k    0     0   981k      0  0:00:02  0:00:02 --:--:--  981k
  -> È stato trovato rtl8761usb.conf
==> Validazione di source file con md5sums...
    20201202_mpow_BH456A_driver+for+Linux.7z ... Verificato
    rtl8761usb.conf ... Verificato
==> Estrazione dei sorgenti in corso...
  -> Estrazione di 20201202_mpow_BH456A_driver+for+Linux.7z usando bsdtar in corso...
==> Avvio di prepare() in corso...
==> Entro nell'ambiente fakeroot...
==> Avvio di package() in corso...
mkdir -p ./lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth
Start Realtek Bluetooth USB driver installation
mkdir -p ./lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_fw to ./lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_fw ./lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_config ./lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_config ./lib/firmware
make -C usb install
make[1]: attenzione: jobserver non disponibile, viene usato -j1. Aggiungere «+» alla regola make superiore.
make[1]: ingresso nella directory «/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb»
rmmod btusb
rmmod: ERROR: could not remove 'btusb': Operation not permitted
rmmod: ERROR: could not remove module btusb: Operation not permitted
make[1]: [Makefile:7: install] Errore 1 (ignorato)
mv ../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb.ko ../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb_bak
mv: impossibile eseguire stat di '../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb.ko': File o directory non esistente
make[1]: [Makefile:8: install] Errore 1 (ignorato)
rmmod rtk_btusb
rmmod: ERROR: Module rtk_btusb is not currently loaded
make[1]: [Makefile:9: install] Errore 1 (ignorato)
make -C ./bluetooth_usb_driver
make[2]: ingresso nella directory «/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver»
make -C /lib/modules/5.9.16-1-MANJARO/build M=/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver modules
make[3]: ingresso nella directory «/usr/lib/modules/5.9.16-1-MANJARO/build»
make[3]: ***  Nessuna regola per generare l'obiettivo «modules».  Arresto.
make[3]: uscita dalla directory «/usr/lib/modules/5.9.16-1-MANJARO/build»
make[2]: *** [Makefile:10: all] Errore 2
make[2]: uscita dalla directory «/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver»
make[1]: *** [Makefile:10: install] Errore 2
make[1]: uscita dalla directory «/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb»
make: *** [Makefile:28: install] Errore 2
==> ERRORE: Si è verificato un errore in package().
    L'operazione sta per essere interrotta...

You’re only cloning the AUR package repo and still trying to install it manually.

See:

sudo pacman -Syu --needed base-devel git
git clone https://aur.archlinux.org/rtl8761usb.git
cd rtl8761usb
makepkg -srcif

Same error with -srcif and i also tried to install it from pamac but nothing works.
base-devel and git are installed and updated

you could start the makepkg process with:
LANG=C makepkg -i
so that we can comprehend the messages which are now in italian.
(I usually only use -i and don’t know why @Yochanan recommended the other options
one of them if for a clean build, the other is force …)

… something seems to be missing - maybe the kernel headers?

Here is the english one:

==> Making package: rtl8761usb 20201202-2 (dom 21 feb 2021, 17:54:54)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found 20201202_mpow_BH456A_driver+for+Linux.7z
  -> Found rtl8761usb.conf
==> Validating source files with md5sums...
    20201202_mpow_BH456A_driver+for+Linux.7z ... Passed
    rtl8761usb.conf ... Passed
==> Extracting sources...
  -> Extracting 20201202_mpow_BH456A_driver+for+Linux.7z with bsdtar
==> Starting prepare()...
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
mkdir -p ./lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth
Start Realtek Bluetooth USB driver installation
mkdir -p ./lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_fw to ./lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_fw ./lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_config ./lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_config ./lib/firmware
make -C usb install
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb'
rmmod btusb
rmmod: ERROR: could not remove 'btusb': Operation not permitted
rmmod: ERROR: could not remove module btusb: Operation not permitted
make[1]: [Makefile:7: install] Error 1 (ignored)
mv ../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb.ko ../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb_bak
mv: cannot stat '../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb.ko': No such file or directory
make[1]: [Makefile:8: install] Error 1 (ignored)
rmmod rtk_btusb
rmmod: ERROR: Module rtk_btusb is not currently loaded
make[1]: [Makefile:9: install] Error 1 (ignored)
make -C ./bluetooth_usb_driver
make[2]: Entering directory '/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver'
make -C /lib/modules/5.9.16-1-MANJARO/build M=/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver modules
make[3]: Entering directory '/usr/lib/modules/5.9.16-1-MANJARO/build'
make[3]: *** No rule to make target 'modules'.  Stop.
make[3]: Leaving directory '/usr/lib/modules/5.9.16-1-MANJARO/build'
make[2]: *** [Makefile:10: all] Error 2
make[2]: Leaving directory '/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver'
make[1]: *** [Makefile:10: install] Error 2
make[1]: Leaving directory '/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb'
make: *** [Makefile:28: install] Error 2
==> ERROR: A failure occurred in package().
    Aborting...

yepp - it looks like you are missing the kernel headers for your 5.9.16 kernel

I tried installing them with
sudo pacman -S linux-headers
but nothing changed, i still get this error

the same error?

What is in this directory?

ls -hl /usr/lib/modules/5.9.16-1-MANJARO/build

Output

[steve@manjaro-fisso rtl8761usb]$ ls -hl /usr/lib/modules/5.9.16-1-MANJARO/build
totale 71M
-rw-r--r-- 1 root root 71M 21 dic 22.59 vmlinux

that means that despite you thinking you installed the kernel headers - you really didn’t
you surely didn’t install the headers for linux59

sudo pacman -S linux59-headers

should do that

sudo pacman -S linux-headers
gave me a multiple choice menu - but just one time
once headers are installed, it defaults to that choice

Ok, something changed and i think we are getting closer, now i arrive at the confirmation but i do get another error:

[steve@manjaro-fisso rtl8761usb]$ LANG=c makepkg -i
==> Making package: rtl8761usb 20201202-2 (Sun Feb 21 18:56:30 2021)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading 20201202_mpow_BH456A_driver+for+Linux.7z...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2158k  100 2158k    0     0  1031k      0  0:00:02  0:00:02 --:--:-- 1031k
  -> Found rtl8761usb.conf
==> Validating source files with md5sums...
    20201202_mpow_BH456A_driver+for+Linux.7z ... Passed
    rtl8761usb.conf ... Passed
==> Extracting sources...
  -> Extracting 20201202_mpow_BH456A_driver+for+Linux.7z with bsdtar
bsdtar: Failed to set default locale
==> Starting prepare()...
==> Entering fakeroot environment...
==> Starting package()...
mkdir -p ./lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth
Start Realtek Bluetooth USB driver installation
mkdir -p ./lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_fw to ./lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_fw ./lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_config ./lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_config ./lib/firmware
make -C usb install
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb'
rmmod btusb
rmmod: ERROR: could not remove 'btusb': Operation not permitted
rmmod: ERROR: could not remove module btusb: Operation not permitted
make[1]: [Makefile:7: install] Error 1 (ignored)
mv ../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb.ko ../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb_bak
mv: cannot stat '../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/btusb.ko': No such file or directory
make[1]: [Makefile:8: install] Error 1 (ignored)
rmmod rtk_btusb
rmmod: ERROR: Module rtk_btusb is not currently loaded
make[1]: [Makefile:9: install] Error 1 (ignored)
make -C ./bluetooth_usb_driver
make[2]: Entering directory '/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver'
make -C /lib/modules/5.9.16-1-MANJARO/build M=/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver modules
make[3]: Entering directory '/usr/lib/modules/5.9.16-1-MANJARO/build'
  CC [M]  /home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver/rtk_coex.o
  CC [M]  /home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver/rtk_misc.o
  CC [M]  /home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver/rtk_bt.o
  LD [M]  /home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver/rtk_btusb.o
  MODPOST /home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver/Module.symvers
  CC [M]  /home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver/rtk_btusb.mod.o
  LD [M]  /home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver/rtk_btusb.ko
make[3]: Leaving directory '/usr/lib/modules/5.9.16-1-MANJARO/build'
make[2]: Leaving directory '/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver'
cp -f ./bluetooth_usb_driver/rtk_btusb.ko ../lib/modules/5.9.16-1-MANJARO/kernel/drivers/bluetooth/rtk_btusb.ko
# depmod -a 5.9.16-1-MANJARO
make -C ./bluetooth_usb_driver clean
make[2]: Entering directory '/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver'
rm -rf *.o *.mod.c *.mod.o *.ko *.symvers *.order *.a
make[2]: Leaving directory '/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver'
echo "install rtk_btusb success!"
install rtk_btusb success!
make[1]: Leaving directory '/home/steve/Programmi/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb'
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "rtl8761usb"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: rtl8761usb 20201202-2 (Sun Feb 21 18:56:36 2021)
==> Installing package rtl8761usb with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) rtl8761usb-20201202-2

Total Installed Size:  0.83 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                                                         [#############################################################################################] 100%
(1/1) checking package integrity                                                                                                                       [#############################################################################################] 100%
(1/1) loading package files                                                                                                                            [#############################################################################################] 100%
(1/1) checking for file conflicts                                                                                                                      [#############################################################################################] 100%
error: failed to commit transaction (conflicting files)
rtl8761usb: /usr/lib/firmware/rtl8761bu_config exists in filesystem
rtl8761usb: /usr/lib/firmware/rtl8761bu_fw exists in filesystem
Errors occurred, no packages were upgraded.
==> WARNING: Failed to install built package(s).

I think a solution may be removing conflicting files, but it doesn t feel so smart to me lol

I have no good idea - I’d start fresh.
If there are conflicting files then these probably need to go.
perhaps use the command @Yochanan gave you:

makepkg -srcif

I know that I just built successfully with:
pamac build rtl8761usb

Ok,
makepkg -srcif
didnt work, but
pamac build rtl8761usb
did and audio is working great :smiley: thank you so much to everyone for your help and your patient :smiley: :bowing_man:


      -c, --clean
           Clean up leftover work files and directories after a successful
           build.

      -f, --force
           makepkg will not build a package if a built package already exists
           in the PKGDEST (set in makepkg.conf(5)) directory, which may
           default to the current directory. This allows the built package to
           be overwritten.

      -i, --install
           Install or upgrade the package after a successful build using
           pacman(8).

      -r, --rmdeps
           Upon successful build, remove any dependencies installed by makepkg
           during dependency auto-resolution and installation when using -s.

      -s, --syncdeps
           Install missing dependencies using pacman. When build-time or
           run-time dependencies are not found, pacman will try to resolve
           them. If successful, the missing packages will be downloaded and
           installed.

linux-headers are a build dependency, it probably should be a runtime dependency.

Oh really? That makes no sense, they’re effectively the same thing.

You mean I just wasted time rewriting the PKGBUILD to fix the broken Makefiles? :man_facepalming:

Glad it’s working either way. :+1:

It seems he didn’t have any headers installed.

The

makedepends=('linux-headers')

in the PKGBUILD
seems to default to 1)
which is
linux414-headers

LANG=C sudo pacman -S linux-headers
:: There are 10 providers available for linux-headers:
:: Repository core
   1) linux414-headers  2) linux419-headers  3) linux44-headers  4) linux49-headers  5) linux510-headers  6) linux511-headers  7) linux54-headers
   8) linux59-headers
:: Repository community
   9) linux54-rt-headers  10) linux59-rt-headers

Enter a number (default=1): 

which is the wrong version for the currently running kernel

I don’t know …
I didn’t look at the PKGBUILD until now
and compared it with what happens when one just installs the linux-headers (probably) using defaults.

edit:

no - if no headers are installed, it actually asks for the version too
but at that point I had already told him to install the correct version …

LANG=C pamac build rtl8761usb
Preparing...
Cloning rtl8761usb build files...
Checking rtl8761usb dependencies...
Choose a provider for linux-headers:
 1:  linux414-headers    4.14.221-1                 core
 2:  linux419-headers    4.19.175-1                 core
 3:  linux44-headers     4.4.257-1                  core
 4:  linux49-headers     4.9.257-1                  core
 5:  linux510-headers    5.10.15-1                  core
 6:  linux511-headers    5.11.rc7.d0207.g92bf226-1  core
 7:  linux54-headers     5.4.97-1                   core
 8:  linux59-headers     5.9.16-1                   core
 9:  linux54-rt-headers  5.4.93_rt51-1              community
10:  linux59-rt-headers  5.9.1_rt19-1               community

Enter a number (default=1):

If I may borrow this post, I encounter the same problem and was able to follow the thread to some extent. However, I still can’t get my bluetooth driver to work.
Here’s where I am so far.

[will@will-b365m rtl8761usb]$ LANG=C makepkg -i
==> Making package: rtl8761usb 20201202-3 (Fri Aug  6 11:22:11 2021)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found 20201202_mpow_BH456A_driver+for+Linux.7z
==> Validating source files with md5sums...
    20201202_mpow_BH456A_driver+for+Linux.7z ... Passed
==> Extracting sources...
  -> Extracting 20201202_mpow_BH456A_driver+for+Linux.7z with bsdtar
==> Starting prepare()...
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
mkdir -p ./lib/modules/5.10.53-1-MANJARO/kernel/drivers/bluetooth
Start Realtek Bluetooth USB driver installation
mkdir -p ./lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_fw to ./lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_fw ./lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_config ./lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_config ./lib/firmware
make -C usb install
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/home/will/Linux/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb'
# rmmod btusb
mv ../lib/modules/5.10.53-1-MANJARO/kernel/drivers/bluetooth/btusb.ko ../lib/modules/5.10.53-1-MANJARO/kernel/drivers/bluetooth/btusb_bak
mv: cannot stat '../lib/modules/5.10.53-1-MANJARO/kernel/drivers/bluetooth/btusb.ko': No such file or directory
make[1]: [Makefile:8: install] Error 1 (ignored)
# rmmod rtl8761usb
make -C ./bluetooth_usb_driver
make[2]: Entering directory '/home/will/Linux/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver'
make -C /lib/modules/5.10.53-1-MANJARO/build M=/home/will/Linux/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver modules
make[3]: Entering directory '/home/will/Linux/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver'
make[3]: *** /lib/modules/5.10.53-1-MANJARO/build: No such file or directory.  Stop.
make[3]: Leaving directory '/home/will/Linux/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver'
make[2]: *** [Makefile:10: all] Error 2
make[2]: Leaving directory '/home/will/Linux/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb/bluetooth_usb_driver'
make[1]: *** [Makefile:10: install] Error 2
make[1]: Leaving directory '/home/will/Linux/rtl8761usb/src/20201202_LINUX_BT_DRIVER/usb'
make: *** [Makefile:28: install] Error 2
==> ERROR: A failure occurred in package().
    Aborting...

when entering the following

ls -hl /usr/lib/modules/5.9.16-1-MANJARO/build

an error message returns:

ls: 無法存取 '/usr/lib/modules/5.9.16-1-MANJARO/build': 沒有此一檔案或目錄

(no such file or folder)
I guess this is where I got stuck, but I really don’t know. I have limited knowledge of linux and this is my first few hours with Manjaro. Any assistance will be much appreciated.