Ubuntu Fix Errors

From Indie IT Wiki
Jump to: navigation, search

Broken Samba

Samba got broken when I installed SoGo which installed some Samba 4.1 libraries. Then I couldn't install Samba 3.6 because of dependencies. Then I had to uninstall loads of things I didn't want to.

So, to fix...

  1. find out why the package is caught in dependency hell
  2. remove the offending newer version of packages
  3. clean up
  4. reinstall older (current) version

Here is some history, because I don't have time to muck around this morning...

2063  apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
2064  man aptitude
2065  sudo aptitude install --show-why -s -y -v samba
2066  sudo aptitude reinstall libwbclient0
2067  dpkg -s libwbclient0
2068  sudo aptitude remove libwbclient0
2069  dpkg -r --force-all libwbclient0
2070  sudo aptitude reinstall -s libwbclient0
2071  sudo aptitude reinstall libwbclient0
2072  apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
2073  sudo aptitude install --show-why -s -y -v samba
2074  sudo aptitude install -y -v samba
2075  history


GPG Repository Keys Missing

Copy the following in to a text editor and save as: launchpad-update.sh

#! /bin/sh

# Simple script to check for all PPAs refernced in your apt sources and
# to grab any signing keys you are missing from keyserver.ubuntu.com.
# Additionally copes with users on launchpad with multiple PPAs
# (e.g., ~asac)
# Author: Dominic Evans https://launchpad.net/~oldman
# License: LGPL v2

for APT in `find /etc/apt/ -name *.list`; do
    grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do
        # work out the referenced user and their ppa
        USER=`echo $ENTRY | cut -d/ -f4`
        PPA=`echo $ENTRY | cut -d/ -f5`
        # some legacy PPAs say 'ubuntu' when they really mean 'ppa', fix that up
        if [ "ubuntu" = "$PPA" ]
        # scrape the ppa page to get the keyid
        KEYID=`wget -q --no-check-certificate https://launchpad.net/~$USER/+archive/$PPA -O- | grep -o "1024R/[A-Z0-9]\+" | cut -d/ -f2`
        sudo apt-key adv --list-keys $KEYID >/dev/null 2>&1
        if [ $? != 0 ]
            echo Grabbing key $KEYID for archive $PPA by ~$USER
            sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com $KEYID
            echo Already have key $KEYID for archive $PPA by ~$USER

echo DONE

Alternatively you can download it from here.

Remember to set the file permissions to allow execution of the file.

Run the script via the terminal:


sh ./launchpad-update

Most GPG Key Errors

sudo -i
apt-get clean
cd /var/lib/apt
mv lists lists.old
mkdir -p lists/partial
apt-get clean
apt-get update

ownCloud GPG Key Error


W: GPG error: http://download.opensuse.org  Release: The following signatures were invalid: KEYEXPIRED 1397815516

sudo apt-key list
sudo apt-key del BA684223  (just check this is your ownCloud key)
wget -qO - http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/Release.key | sudo apt-key add -
sudo apt-get update


Broadcom Wireless STA Driver

sudo apt-get purge bcmwl-kernel-source broadcom-sta-common broadcom-sta-source
sudo apt-get install b43-fwcutter firmware-b43-installer
sudo nano /etc/modprobe.d/blacklist.conf  (check for # b43 and enable)
sudo reboot


No Sound In YouTube Videos When Using S/PDIF Digital Audio

This fix follows on from the fix below on AC3 Audio.

If you have no sound in videos on YouTube make sure that your Digital Card is the default sink for PulseAudio.

pacmd list-sinks
pacmd set-default-sink 2

To check...


This should show 'Default Sink' as 'SPDIF'


This should have the tick box pressed in for 'Set As Fallback'

5.1 Surround Sound Digital AC3 Audio S/PDIF PulseAudio


Add or edit this file...


pcm.a52 {
  @args [CARD]
  @args.CARD {
    type string
  type rate
  slave {
    pcm {
      type a52
      bitrate 448
      channels 6
      card $CARD
  rate 48000 #required somehow, otherwise nothing happens in PulseAudio

Build the library files, and copy them to the correct locations...

sudo apt-get build-dep libasound2-plugins
sudo apt-get install libavcodec-dev libavformat-dev
mkdir ~/tmp
cd ~/tmp
apt-get source libasound2-plugins
cd alsa-plugins-*
libtoolize --force --copy && aclocal && autoconf && automake && make
cd a52/.libs
sudo cp libasound_module_pcm_a52.la libasound_module_pcm_a52.so /usr/lib/x86_64-linux-gnu/alsa-lib/
sudo cp libasound_module_pcm_a52.so /usr/lib/`uname -i`-linux-gnu/alsa-lib/

Edit these files to add the new 'SPDIF' sink to PulseAudio...


# s/pdif tweaks
load-module module-alsa-sink device=a52 rate=48000 channels=6 tsched=0 sink_properties=device.description=SPDIF sink_name=SPDIF channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe


; default-sample-format = s16le
default-sample-rate = 48000
default-sample-channels = 6
default-channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe

Restart ALSA and PulseAudio...

sudo alsa reload
pulseaudio --kill
pulseaudio --start
pidof pulseaudio

Various tests...

pacmd list-sinks
speaker-test -t wav -c 6 -D a52
vlc dvd://

Fix VLC to play 5.1 Channel Surround instead of 2 Channel Stereo...

Tools > Preferences > Show Settings > All > Audio > Output Modules > ALSA
      > Audio Output Device > Default
      > Audio Output Channels > Surround 5.1


Tearing Picture In VLC Videos

VLC | Tools Preferences | Video | Accelerated Video Output (Overlay) | Save

YouTube Blue Faces Fix with NVIDIA Cards


Reset $PATH to factory default


Thanks to Superuser.com.

Blank / Black / Missing Login Screen


"From the command line, please enter sudo dpkg-reconfigure xserver-xorg. Keep the default answers if you do not know what to answer. Pay attention to your screen settings, this is probably what makes your graphical session (starting with GDM) not available. Once you're done, enter sudo reboot, and your session should be running back again."

Random Missing DVD

After a while (perhaps 1 use upon a fresh cold computer start) you may 'lose' your DVD drive. This seems to be a bug with either UDEV or HAL in Ubuntu Linux 9.10 - the symlinks for nodes like 'cdrom' or 'dvd' disappear...

This is what they should look like:-

lrwxrwxrwx 1 root root 3 2010-12-14 09:53 /dev/cdrom -> sr0
lrwxrwxrwx 1 root root 3 2010-12-14 09:54 /dev/cdrw -> sr0
lrwxrwxrwx 1 root root 3 2010-12-14 09:54 /dev/dvd -> sr0
lrwxrwxrwx 1 root root 3 2010-12-14 09:54 /dev/dvdrw -> sr0

To fix this, first check that you have the actual device (like sr0)...

root@mythbuntu-server2:~# dmesg |grep -i dvd
[    1.664900] ata3.00: ATAPI: HL-DT-ST BDDVDRW GGC-H20L, 1.03, max UDMA/133
[    1.793129] scsi 2:0:0:0: CD-ROM            HL-DT-ST BDDVDRW GGC-H20L 1.03 PQ: 0 ANSI: 5
[    2.123681] sr0: scsi3-mmc drive: 40x/40x writer dvd-ram cd/rw xa/form2 cdda tray

root@mythbuntu-server2:~# lshw -c disk
      description: DVD-RAM writer
      product: BDDVDRW GGC-H20L
      vendor: HL-DT-ST
      physical id: 1
      bus info: scsi@2:0.0.0
      logical name: /dev/cdrom
      logical name: /dev/cdrw
      logical name: /dev/dvd
      logical name: /dev/dvdrw
      logical name: /dev/scd0
      logical name: /dev/sr0
      version: 1.03
      capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
      configuration: ansiversion=5 status=nodisc

...then recreate the symbolic links:-

sudo -i
cd /dev/
ln -s sr0 cdrom
ln -s sr0 cdrw
ln -s sr0 dvd
ln -s sr0 dvdrw

UPDATE #1 - despite doing the above, you can still lose your DVD drive. It actually comes down to Ubuntu thinking the tray is open, when it is clearly not!

setcd -i   (this will show "CD Tray is open")
lshw -c disk   (this will show "status=open")

This is obviously a software bug (probably udev or hal) but there is no known software cure, except to reboot :-(

UPDATE #2 - someone has suggested appending the word noapic to the grub boot menu and rebooting...

sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noapic"

...so far, so good!

Broken Package Update Upgrade Database

sudo mkdir /var/cache/debconf
sudo touch /var/cache/debconf/.dont-delete-this-directory
sudo apt-get update --fix-missing
sudo apt-get autoremove && sudo apt-get clean && sudo apt-get install -f


ERROR: ubuntu boot failed device or resource busy

Possibly a hard disk fault or the fact that the initraamfs has not given enough time for the RAID devices to assemble properly.

The fix is to add a delay to the boot process.

  1. Hold the right SHIFT key down to bring up the GRUB menu
  2. Select 'Advanced options for Ubuntu...'
  3. Choose 'Ubuntu Recovery Mode'
  4. Press the e key
  5. Add rootdelay=90 on the line just before the root= part
  6. Press F10 to boot into Recovery Mode
  7. FSCK the disks
  8. Drop to root prompt
  9. reboot
  10. Repeat for normal 'Ubuntu' line
  11. When properly booted, do the following...
sudo -i
echo "sleep 60" > /etc/initramfs-tools/scripts/init-premount/delay_for_raid_array_to_build_before_mounting
chmod a+x /etc/initramfs-tools/scripts/init-premount/delay_for_raid_array_to_build_before_mounting
update-initramfs -u

Thanks - http://ubuntuforums.org/showthread.php?t=2241430

Thanks - http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/re58.html

ERROR: No apport report written because MaxReports has already been reached

I got away with it by Editing the status file. Just remove the entry of the software causing trouble.

sudo gedit /var/lib/dpkg/status
sudo apt-get install --reinstall <package>
sudo apt-get update; sudo apt-get install -f

Failed To Fetch archive.ubuntu on apt-get update

Failed to fetch http://archive.ubuntu.com/ubuntu/dists/maverick/main/binary-i386/Packages.gz  404  Not Found

Change all entries for archive.ubuntu.com for old-releases.ubuntu.com in /etc/apt/souces.list

Broken Package Manager In Old Ubuntu Versions

Edit the file...

sudo nano /etc/apt/souces.list

...and change all references from archive.ubuntu.com to old-releases.ubuntu.com...

# deb cdrom:[Ubuntu 10.10 _Maverick Meerkat_ - Release i386 (20101007)]/ maverick main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://old-releases.ubuntu.com/ubuntu/ maverick main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick main restricted

Keyboard Correct Locale Not Being Used

sudo dpkg-reconfigure keyboard-configuration

If this does not work, then you'll have to run this every time you boot...

setxkbmap gb