After the fresh installation of Linux(Ubuntu or any other) your 3.5mm jack /earphone is not working at all.
so in this story, I will provide how you can solve this issue.
so, first of all, you have to install alsamixer
Step 1
type below command in your terminal
sudo apt-get install alsa alsa-tools
make sure you have an internet connection. if you do not have wifi then you can use your phone’s USB tethering to enable internet in your Linux.
Step 2
run below command after you install the alsamixer
sudo alsamixer
this kind of interface will open when you execute above command
Step 3
now press arrow key until you see: HP/Speaker Auto-Detect.
now press the M key to enable it.
by default, it will be off.
Step 4
now again press arrow key until you find: HP/Speaker
and here also press the M key to enable it.
now press the ESC key to exit.
Step 5
we have to save these settings. so we do not have to every time turn it on after a reboot.
so to save settings write below command in your terminal.
sudo alsactl store
if this tutorial solved your issue. then press 👏
thank you