Ubuntu Fix Errors

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

http://askubuntu.com/questions/244985/error-installing-or-upgrading-packages

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 reboot

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 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

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
ERROR W: GPG error: http://download.opensuse.org Release: The following signatures were invalid: KEYEXPIRED 1397815516

Terminal:~$ 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

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 http://old-releases.ubuntu.com/ubuntu/ maverick main restricted deb-src http://old-releases.ubuntu.com/ubuntu/ maverick main restricted
 * 1) deb cdrom:[Ubuntu 10.10 _Maverick Meerkat_ - Release i386 (20101007)]/ maverick main restricted
 * 2) See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
 * 3) newer versions of the distribution.

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

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

Tearing Picture In VLC Videos
vlc Tools > Preferences > Video > Accelerated Video Output (Overlay) Save

Backup / Clone System
On old system...

sudo -i cd / tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/sys --exclude=/mnt --exclude=/media --exclude=/dev /

...then copy the backup.tar.gz to a usb disk drive.

On new system, boot from SystemRescueCD...

mkdir /mnt/sda1 mkdir /mnt/usb mount /dev/sda1 /mnt/sda1 mount /dev/sdb1 /mnt/usb tar -xzvpf /mnt/usb/backup.tar.gz -C /mnt/sda1/ mkdir /mnt/sda1/{dev,lost+found,mnt,media,proc,sys} blkid >> /mnt/sda1/etc/fstab nano /mnt/sda1/etc/fstab mount -t proc none /mnt/sda1/proc mount -o bind /dev /mnt/sda1/dev chroot /mnt/sda1 /bin/bash grub-install /dev/sda update-grub exit reboot

The section in bold is where you fix the hard drive UUIDs so that the system will boot.

https://help.ubuntu.com/community/BackupYourSystem/TAR

GRAPHICS: YouTube Blue Faces Fix with Nvidia Cards
NVIDIA

Blank / Black / Missing Login Screen
http://ubuntu-tutorials.com/2010/05/06/ubuntu-10-04-lucid-blank-screen-at-startup-workaround/

"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."

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

# 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" ] then PPA=ppa fi        # 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 ]        then echo Grabbing key $KEYID for archive $PPA by ~$USER sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com $KEYID else echo Already have key $KEYID for archive $PPA by ~$USER fi    done done echo DONE
 * 1) ! /bin/sh
 * 1) Simple script to check for all PPAs refernced in your apt sources and
 * 2) to grab any signing keys you are missing from keyserver.ubuntu.com.
 * 3) Additionally copes with users on launchpad with multiple PPAs
 * 4) (e.g., ~asac)
 * 1) Author: Dominic Evans https://launchpad.net/~oldman
 * 2) License: LGPL v2

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:

Linux Terminal:~$ sh ./launchpad-update

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 *-cdrom 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!