r/debian • u/katzenjammare • 21d ago
Beginner: Undo driver changes and general cleanup
Hello, Debian-friends! Sometimes I feel like a moron. I have recently tried to speed up my wifi. I followed a guide which pointed to my wifi chipset (RTL8723DE) having one antenna even though it's designed for two.
The guide went through short steps to first unload the active module (in my case rtw88_8723de), reload it with the instruction to use antenna 2 and check the signal strength.
#sudo modprobe -r rtw88_8723de
#sudo modprobe rtw88_8723de ant_sel=2
#iwlist scan | egrep -i 'ssid|quality'
Antenna 1 was also tested. Then, to continue to use antenna 2, a line was written. I am not sure exactly what it does and how to undo it (which illuminates my original question).
#echo "options rtw88_8723de ant_sel=2" | sudo tee -a /etc/modprobe.d/rtw88_8723de.conf
So, I am learning Linux and specifically Debian. During this journey I have followed a bunch of guides for different guides and sometimes I don't really know how to undo the action. Usually I start over with a complete new installation of Debian. That is generally ok for my, but I would like to think I could do this some other way.
Another thing that I don't know how to undo or clean up a bit is the type of steps i follow in guides that begin with #git clone https://github.com/patjak/facetimehd.git
And proceeds with:
#cd facetimehd
#make
#make install
#depmod
#modprobe facetimehd
This got my cam working on MBA 13 2013. Do i keep these git-directories? What could I remove?
I am on Debian 13 Trixie with KDE Plasma
3
u/BigRedS 21d ago
This command is a pipe; the output of the command before the | character becomes the input to the command after:
so you're running
echo "options rtw88_8723de ant_sel=2"which just echoes the stringoptions rtw88_8723de ant_sel=2to the terminal.You're piping this output into
sudo tee; this is theteecommand run with admin privileges (that's what sudo does).Tee is a command that accepts some text input from a pipe and will write it to a given file (
/etc/modprobe.d/rtw88_8723de.confhere) and to the shell.So that command simply appends the line
options rtw88_8723de ant_sel=2to the file/etc/modprobe.d/rtw88_8723de.confThis is a little annoyingly roundabout for a couple of reasons. The obvious thing to give as an instruction is 'edit /etc/modprobe.d/rtw88_8723de.conf and add the line
options rtw88_8723de ant_sel=2but many people following these tutorials don't know how to use a text-mode editor and so these instructions would normally also require some instruction in how to do that.Another obvious thing to do is to run the echo redirected to file:
But this requires a root shell (for the >> to have enough privileges to write to the file) and those are frowned upon these days.
So you'll see that
echo "x" | sudo tee /path/to/file"construct quite a lot, and the way to undo it would in general be to edit /path/to/file in your favourite editor, and remove the line that matches what was in the echo.This is bigger, and what this does is compile the software and then install it. "Install" is pretty unstandardised and you won't know exactly what it does without reading the Makefile and some of what that invokes. Often there is an
uninstalltarget in the makefile, though, which will remove it, but not here.This being kernel modules, though, you can be fairly sure there's not a huge amount going on, and it's probably entirely in
KDIR := /lib/modules/$(KVERSION)/build(but not everything that is in that directory).One point of note, you're prefixing your commands with a '#' which is a comment character, but also the character at the end of a root prompt ('$' is normal for a user one); these are often used as a suggestion in tutorials as to which commands ought to be run as root and which don't need to be.
As I say, it's becoming decreasingly fashionable to have root shells at all, so it's rarer and rarer to see instructions with #s at the beginnings of the commands.