When I first installed it there was sound but after doing updates, upgrades, installations and couple of restarts the sound is gone.
I ran this codes -
sudo alsa force-reload
Then restarted but no luck.
Then I tried,
sudo apt-get remove --purge alsa-base pulseaudio
sudo apt-get install alsa-base pulseaudio
sudo alsa force-reload
But still no luck.
I found a way to get back the sound.
I ran this code -
and got
Now the sound is back.
The problem was it was not detecting any Hardware Output Devices
Have you checked the output options at sound settings?
After having updated my hardware (graphic card with built-in sound module) the setting had changed without notice. Also there were two different HDMI devices listed. Only one of them was working.
I am using ubuntu 18.04. In my case, Audio suddenly stopped working. Tried a bunch of hacks shared by other users but no luck. But the following command worked instantly:
for me I removed google-chrome-remote-desktop and it worked!
If on (k)ubuntu 18.04 and other answers fails
and if
sudo alsa force-reload
says no modules were loaded, try this:and then reboot. The kernel update script had a problem in some kernels around version 4.15.0-... Supposedly, it was fixed from kernel version 4.15.0-109 onward, but in my case 4.15.0-109 and 4.15.0-111 caused another problem, with expanding kernel and system logs till my disk was full. The above works best and gets you to the newest kernel supported for 18.04 LTS (there are similar packages for other LTS versions).