Ubuntu: Generic Hints Tweaks and Tips

In a terminal example anything shown in bold after Terminal:~$ is a comment and is not to be run, e.g:

Terminal:~$ sudo apt-get install fish Then scratch your ear

So in the above Then scratch your ear is not to be run in the terminal

APPORT
Apport (much like the Windows Error Reporting tool) is enabled by default to change this behaviour:

Terminal:~$ sudo nano /etc/default/apport

Edit the file to match below (changes shown in bold):

enabled=0
 * 1) set this to 0 to disable apport, or to 1 to enable it
 * 2) you can temporarily override this with
 * 3) sudo service apport start force_start=1

To re-enable just revert the 'enabled' line back to '1'

AUTOMATIC MOUNTING OF EXTERNAL MEDIA
By default Ubuntu will automatically mount USB drives/optical disks and open them in the default file manager, to disable this behaviour:

ALT + F2, then type in gconf-editor, and press Enter

Navigate to apps >> nautilus >> preferences, then uncheck 'media_automount_open'

Gnome 2

ALT + F2, then type in gconf-editor and select.

Navigate to: apps >> nautilus >> preferences >> media automount (untick)

Gnome 3 - Unity

ALT + F2, to bring up the Dash, then type dconf-editor and select.

Navigate to: org >> gnome >> desktop >> media-handling >> automount (untick)

DNSMasq
Terminal:~$ sudo nano /etc/NetworkManager/NetworkManager.conf

Comment out the dns=dnsmasq line using # as shown in the example below:

[main] plugins=ifupdown,keyfile,ofono # dns=dnsmasq [ifupdown] managed=false

Thanks Ubuntu Geek.

INSTALLATION OF RECOMMENDED PACKAGES
There is a way to stop installing the so-called “recommends” packages automatically. For single packages, you should use the --no-install-recommends switch with apt-get. To turn off installing recommends for all packages, do one of the following:

APT:Install-Recommends "false"
 * In Synaptic, go to Settings » Preferences » tab General and uncheck “Consider recommended packages as dependencies”
 * Create the file /usr/apt/apt.conf.d/05norecommends and add the following line in the file:

OPTICAL DRIVE AUTO CLOSE
Quick fix...

Terminal:~$ sudo sysctl -w dev.cdrom.autoclose=0

...and to survive a reboot...

Terminal:~$ nano /etc/sysctl.d/60-cdrom-autoclose.conf dev.cdrom.autoclose = 0
 * 1) do not autoclose cdrom

SUSPEND ITEM ON SESSION MENU
Terminal:~$ sudo nano /usr/share/polkit-1/actions/org.freedesktop.upower.policy

There are two sections in this file, the first for suspend and the second for hibernate; as shown below.

 

Near the end of each section will be a line with:

yes

Change this entry from “yes” to “no” to disable hibernate/suspend.

no

Thanks Liberian Geek.

SYNAPTIC TOUCHPAD
Terminal:~$ synclient TouchpadOff=1 To disable synclient TouchpadOff=2 To enable

List of options:

Terminal@~$ synclient -l Output Parameter settings: For ease of reading the list I have put it in to alphabetical order AccelFactor            = 0.0359777 AreaBottomEdge         = 0 AreaLeftEdge           = 0 AreaRightEdge          = 0 AreaTopEdge            = 0 BottomEdge             = 4550 CircScrollDelta        = 0.1 CircScrollTrigger      = 0 CircularPad            = 0 CircularScrolling      = 0 ClickFinger1           = 1 ClickFinger2           = 1 ClickFinger3           = 0 ClickPad               = 0 ClickTime              = 100 CoastingFriction       = 50 CoastingSpeed          = 20 CornerCoasting         = 0 EmulateMidButtonTime   = 75 EmulateTwoFingerMinW   = 7 EmulateTwoFingerMinZ   = 282 FingerHigh             = 30 FingerLow              = 25 GrabEventDevice        = 1 HorizEdgeScroll        = 0 HorizHysteresis        = 27 HorizScrollDelta       = 111 HorizTwoFingerScroll   = 1 LBCornerButton         = 0 LeftEdge               = 1781 LockedDrags            = 0 LockedDragTimeout      = 5000 LTCornerButton         = 0 MaxDoubleTapTime       = 180 MaxSpeed               = 1.75 MaxTapMove             = 244 MaxTapTime             = 180 MinSpeed               = 1 PalmDetect             = 0 PalmMinWidth           = 10 PalmMinZ               = 200 PressureMotionMaxFactor = 1 PressureMotionMaxZ     = 160 PressureMotionMinFactor = 1 PressureMotionMinZ     = 30 RBCornerButton         = 3 ResolutionDetect       = 1 RightEdge              = 5579 RTCornerButton         = 2 SingleTapTimeout       = 180 TapAndDragGesture      = 1 TapButton1             = 1 TapButton2             = 3 TapButton3             = 0 TopEdge                = 1644 TouchpadOff            = 2 VertEdgeScroll         = 0 VertHysteresis         = 27 VertScrollDelta        = 111 VertTwoFingerScroll    = 1

A whole host of information can be found at Arch Linux.

TRACKER SERVICE
The Tracker project can be found here.

Terminal:~$ sudo apt-get remove libtracker-extract-0.16-0 libtracker-miner-0.16-0 tracker-extract tracker-miner-fs tracker-utils

USER ACCOUNT
Terminal:~$ sudo passwd -l username

To re-enable the account:

Terminal:~$ sudo passwd -u username

WHITE DOTS ON THE LIGHTDM LOG IN SCREEN
The following creates a new user 'lightdm' and logs in to that profile so remember to use CTRL+C to return to your own profile in the terminal.

Terminal:~$ sudo xhost +SI:localuser:lightdm sudo su lightdm -s /bin/bash gsettings set com.canonical.unity-greeter draw-grid false

BASH Command Line Smart Completion
Edit the following file and uncomment the lines shown in bold below... Linux Terminal:~$ sudo nano /etc/bash.bashrc

Edit the following lines:

'''if [ -f /etc/bash_completion ] && ! shopt -oq posix; then''' . /etc/bash_completion fi
 * 1) enable bash completion in interactive shells

Ctrl-Alt-Backspace Disabled By Default In Xorg 9.04 onwards
The option of Ctrl+Alt+Backspace key combination to force a restart of X is now disabled by default, with the aim of eliminating the problem of accidentally triggering the key combination. The following re-enables the behaviour.

System >> Preferences >> Keyboard >> Layouts (tab)

Click the 'Layout Options' button

Click on "Key sequence to kill the X server" option to expand it

Tick the check box to enable

DVD Menu Navigation
Linux Terminal:~$ sudo apt-get install libdvdread4 sudo /usr/share/doc/libdvdread4/install-css.sh

GRUB Boot Menu
Edit the following file:-

Terminal:~$ sudo nano /etc/default/grub

Change the lines in bold to match what is shown below:-

GRUB_DEFAULT=0 # GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=false GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX=""

Save and close nano then run the following commands:-

Terminal:~$ sudo update-grub && sudo reboot

.deb Files
Terminal:~$ sudo dpkg -i filename.deb or sudo dpkg -i --force-depends *.deb

Download But Not Install A Package
sudo aptitude download package-name

Fonts
Up to and including 09.04 - copy the font file to /usr/share/fonts/ directory and run

Terminal:~$ fc-cache -f -v

09.10 - copy the font file to /usr/share/fonts/ directory and run

From and including 10.04 - right click on font and choose install OR double click and press Install button

Icon Sets
If required unzip your icons set and then copy the folder using the command below in a terminal:

Terminal:~$ sudo cp -r  /usr/share/icons

mesa-utils
mesa-utils provides several basic GL utilities, including glxinfo and glxgears.

Terminal:~$ sudo apt-get install mesa-utils

Restricted Extras
Terminal:~$ sudo apt-get install ubuntu-restricted-extras

Upgrade Policy
Check the file /etc/update-manager/release-upgrades. Prompt=normal is needed when upgrading from any version to a newer version, Prompt=never will never upgrade your OS. Prompt=lts will make sure you upgrade from LTS to LTS. You need to be root to edit this file.

sudo nano -w /etc/update-manager/release-upgrades

Testing
sudo do-release-upgrade -s

HOWTO: Use Ubuntu Nemo File Manager With Specific User Name
Type the following into the address bar of Nemo...

smb://username@123.456.789.0/sharedfolder/

DEFAULT TEXT EDITOR SYSTEM WIDE
Terminal:~$ sudo update-alternatives --config editor

The available alternatives will be displayed, enter its number and press return.

HOWTO: See The Contents Of A Downloaded Debian Package File
sudo dpkg-deb -c package-file.deb

HOWTO: Run A Command On System Startup As Another User
Edit /etc/rc.local and add a line like the following...

su -c 'mpdscribble' paully & exit 0
 * 1) mpdscribble
 * 1) last line

http://askubuntu.com/questions/90406/startup-script-for-a-specific-user-on-ubuntu-server

A Single Package Using Aptitude
Terminal:~$ sudo aptitude safe-upgrade 'packagename'

A Package Group Using Aptitude
Terminal:~$ sudo aptitude safe-upgrade '~ipartofpackagename' e.g. sudo aptitude safe-upgrade -v -s '~iclamav' sudo aptitude safe-upgrade -y '~iclamav'

A Deb Package Without Removing Its Dependencies
Do not use aptitude, use dpkg instead...

Terminal:~$ sudo dpkg --remove packagename

Packages With Matching Name
sudo aptitude purge '~npackagename' e.g. sudo aptitude purge '~nabiword'

Learn What The Aptitude Results Mean
i: Installed package c: Package not installed, but package configuration remains on system p: Purged from system v: Virtual package B: Broken package u: Unpacked files, but package not yet configured C: Half-configured - Configuration failed and requires fix H: Half-installed - Removal failed and requires fix

Thanks to Server Guide

Clear The Apt Get Cache
To clear the unused downloaded packages:

Terminal:~$ sudo apt-get autoclean

To clear all downloaded packages:

Terminal:~$ sudo apt-get clean

Handy Commands To Run
After a basic install and addition of repositories the following are handy commands to run:

Terminal:~$ sudo apt-get dist-upgrade sudo apt-get update sudo apt-get upgrade sudo apt-get autoremove sudo apt-get update && sudo apt-get --yes upgrade && sudo aptitude -y safe-upgrade

Take A Video Capture Of Your Desktop
Terminal:~$ ffmpeg -f x11grab -r 25 -s 800x600 -i :0.0 -flags gray /tmp/outputFile.mpg

UBUNTU VERSIONS
Ubuntu 15.04 is "vivid" Ubuntu 14.10 is "utopic" Ubuntu 14.04.* is "trusty" Ubuntu 13.10 is "saucy" Ubuntu 13.04 is "raring" Ubuntu 12.04.* is "precise" Ubuntu 11.10 is "oneiric" Ubuntu 11.04 is "natty" Ubuntu 10.10 or Trisquel 4.5 is "maverick" Ubuntu 10.04 or Trisquel 4.0 is "lucid" Ubuntu 9.10 or Trisquel 3.5 is "karmic" Ubuntu 9.04 is "jaunty" Ubuntu 8.10 is "intrepid" Ubuntu 8.04 is "hardy" Debian Etch is "etch" Debian Lenny is "lenny"

HOWTO: Stop / Blacklist Modules On Grub Boot
You can also blacklist modules from the bootloader.

Simply add modprobe.blacklist=modname1,modname2,modname3 to your bootloader's kernel-line parameter list.

To do this, press the RIGHT SHIFT key on Ubuntu Boot to show the GRUB Menu. Press the e key to edit, then add the modprobe.blacklist=modulename to the end of the kernel line...

linux /boot/vmlinuz-3.8.0-32-generic root=UUID=1726742d-f8ff-4fd2-a0e3-75c1dd57b65a ro noquiet nosplash modprobe.blacklist=wl

...then press CTRL+X to boot with these temporary options.

Applications Where Their Components Are Installed
The first step below will help you identify the system name for the software, that is what the operating systems sees it as not what your call it. In this example we are using Adobe's Flash.

Terminal:~$ sudo dpkg -l | grep flash

The returned out put will look similar to this:

Linux Terminal:~$ ii adobe-flashplugin 11.2.202.228-0oneiric1 Adobe Flash Player plugin version 11

Next:

Terminal:~$ sudo dpkg -L adobe-flashplugin

The output generated will look similar to the following:

Terminal:~$ /. /usr /usr/lib /usr/lib/xulrunner /usr/lib/xulrunner/plugins /usr/lib/xulrunner-addons /usr/lib/xulrunner-addons/plugins /usr/lib/mozilla /usr/lib/mozilla/plugins /usr/lib/iceape /usr/lib/iceape/plugins /usr/lib/iceweasel /usr/lib/iceweasel/plugins /usr/lib/firefox /usr/lib/firefox/plugins /usr/lib/midbrowser /usr/lib/midbrowser/plugins /usr/lib/adobe-flashplugin /usr/lib/adobe-flashplugin/libflashplayer.so /usr/share /usr/share/icons /usr/share/icons/hicolor /usr/share/icons/hicolor/32x32 /usr/share/icons/hicolor/32x32/apps /usr/share/icons/hicolor/32x32/apps/flash-player-properties.png /usr/share/icons/hicolor/22x22 /usr/share/icons/hicolor/22x22/apps /usr/share/icons/hicolor/22x22/apps/flash-player-properties.png /usr/share/icons/hicolor/24x24 /usr/share/icons/hicolor/24x24/apps /usr/share/icons/hicolor/24x24/apps/flash-player-properties.png /usr/share/icons/hicolor/16x16 /usr/share/icons/hicolor/16x16/apps /usr/share/icons/hicolor/16x16/apps/flash-player-properties.png /usr/share/icons/hicolor/48x48 /usr/share/icons/hicolor/48x48/apps /usr/share/icons/hicolor/48x48/apps/flash-player-properties.png /usr/share/pixmaps /usr/share/doc /usr/share/doc/adobe-flashplugin /usr/share/doc/adobe-flashplugin/copyright /usr/share/doc/adobe-flashplugin/changelog.Debian.gz /usr/share/pixmaps/flash-player-properties.png

Repositories and Back Up The Listing
'''Terminal:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup or '''Terminal:~$

Software Dependencies - or What Associated Packages Does A Programme Rely On?
First you will need to install an additional package:

Terminal:~$ sudo apt-get install apt-rdepends

Once installed in a terminal:

Terminal:~$ apt-rdepends

For example:

Terminal:~$ apt-rdepends remmina

Most packages will output more data than the standard settings for the terminal will allow, in these instances you can use the pipe command:

Terminal:~$ apt-rdepends apache2 | more apt-rdepends apache2 | less

Services Running
Terminal:~$ service --status-all

Installed Packages And Use It To Reinstall Packages
Terminal:~$ sudo dpkg --get-selections | grep -v deinstall > ubuntu-files

The file 'ubuntu-files' is created in the root directory of your home folder, save it to a safe place like a USB drive.

''' Installing packages on another Ubuntu installation. '''

When you have finished and rebooted, run the following commands to update...

Terminal:~$ sudo apt-get update sudo apt-get dist-upgrade

Now copy that special file from your USB drive to the root directory of your home folder, and run the following commands to set the list of software you wish to install to match the first PC...

Terminal:~$ dpkg --set-selections < ubuntu-files sudo dselect

Reboot and enjoy the extra time you just saved... :-)

Method A
To disable gdm from running during boot, you can either boot with the "text" boot parameter or disable the rc service like this:-

Terminal:~$ sudo update-rc.d -f gdm remove sudo update-rc.d -f x11-common remove

Then to re-enable it later:-

Terminal:~$ sudo update-rc.d gdm defaults sudo update-rc.d x11-common defaults

This option is useful if gdm or X locks up the system during boot, or if you wish to run X in complete isolation from gdm.

https://wiki.ubuntu.com/X/NonGraphicalBoot

Method B
Terminal:~$ sudo nano /etc/default/grub

Change the following lines:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX_DEFAULT="text"

to:

GRUB_CMDLINE_LINUX_DEFAULT="text"
 * 1) GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

sudo update-grub sudo reboot

HOWTO: Nice Documentation On Package Management
http://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/

File --> Open --> Cannot See Hidden Files
By default the 'Open' dialogue window does not show hidden files or folders.

To display them press CTRL+H.

This will then temporarily display the hidden files and folders, they will revert to hidden the next time the 'Open' dialogue is used.

Keyboard Indicator
Allow you to add an indicator applet to the Gnome panel which will show whether your Caps, Scroll or Page Lock keys are inactive or active. It is also configurable to show only those keys you are interested in, for instance on my ThinkPad Edge I am only interested in the Caps Lock.

In a terminal:

sudo apt-get install lock-keys-applet killall gnome-panel

Right click the Gnome panel, click "Add to panel" and add the "Lock Keys" applet. To configure right-click on the applet and select 'Preferences'.

Keyboard Shortcut: Alt+` (or Alt+ the key to the left (on a UK keyboard [correctly known as the Grave accent key]) of the Number 1 Key
This appears to work in Gnome 3 and Unity. Pretty much everyone knows the classic Alt+Tab to scroll through the list of open applications, however using Alt+` will scroll through the open parent and child windows of a particular programme, e.g. Evolution mail with an opened message and a compose window.

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

Command Line Aliases
Open a terminal and edit the .bash_aliases file:

Linux Terminal:~$ nano ~/.bash_aliases

Edit or add the following lines:

alias egrep='egrep --color=auto' alias empty='rm -rf ~/.local/share/Trash/files/*' alias fgrep='fgrep --color=auto' alias get='get_iplayer/get_iplayer' alias grep='grep --color=auto' alias hg='history |grep' alias install='sudo apt-get install' alias l='ls -CF' alias la='ls -A' alias ll='ls -lah' alias ls='ls --color=auto' alias myip='curl ifconfig.me' alias ping='ping -c3 -n -i 0.2 -W1' alias pingg='ping www.google.co.uk' alias pingp='ping www.paully.co.uk' alias pingm='ping 10.0.0.1' alias pings='ping 192.168.0.1' alias rav='rsync -a -v' alias remove='sudo apt-get autoremove' alias rm='rm -iv' alias search='sudo apt-cache search' alias ss='gksudo software-properties-gtk' alias sshg='ssh username@server1.yourserver.com' alias update='sudo apt-get update' alias upgrade='sudo apt-get upgrade' alias uu='sudo apt-get update && sudo apt-get upgrade' alias uuf='sudo apt-get update && sudo apt-get dist-upgrade'

Reload the file:

Linux Terminal:~$ source ~/.bashrc

To confirm the entries:

Linux Terminal:~$ alias

Buttons Location On Window
http://www.howtogeek.com/howto/13535/move-window-buttons-back-to-the-right-in-ubuntu-10.04/

Hostname (or what the computer is called)
The name needs to be changed in the 'hostname' and 'hosts' files.

Linux Terminal:~$ sudo nano /etc/hostname

Edit the name displayed and required, save changes (CTRL+o) then exit (CTRL+x)

Linux Terminal:~$ sudo nano /etc/hosts

127.0.0.1      localhost.localdomain   localhost 127.0.1.1      machine_name_1.fish   machine_name_1

Edit the system name to match that which was entered in the 'hostname' file, save changes (CTRL+o) then exit (CTRL+x)

The line starting 127.0.1.1 is required on an Ubuntu system.

Exit the terminal and reboot the system.

MeMenu Displayed Name
To remove the name from the MeMenu altogether: Linux Terminal:~$ gconftool -s /system/indicator/me/display --type int 0

To show your real name/’about me’ name: Linux Terminal:~$ gconftool -s /system/indicator/me/display --type int 2

To display the default account username:

Linux Terminal:~$ gconftool -s /system/indicator/me/display --type int 1

Instructions gleaned from here.

Panel Icons And Applets Defaults For A New User
'''Linux Terminal:~$ sudo nano /usr/share/gconf/defaults/05_panel-default-setup.entries

For example, to remove the Workspace Switcher Applet, delete these lines...

workspace_switcher <-- Workspace Switcher Applet --> applets/workspace_switcher/object_type /schemas/apps/panel/objects/object_type bonobo-applet ...and all the rest up to (but not including) <-- TrashApplet Applet -->

Save and exit the editor, then run... '''Linux Terminal:~$ sudo update-gconf-defaults

Reboot and add a new user to test.

HOWTO: Run A Script When Computer Is Booted Or Shutdown Or Rebooted
To execute a script at startup of Ubuntu


 * Edit /etc/rc.local and add your commands
 * The script must always end with exit 0

To execute a script upon rebooting Ubuntu


 * Put your script in /etc/rc0.d
 * Make it executable (sudo chmod +x myscript)
 * Note: The scripts in this directory are executed in alphabetical order
 * The name of your script must begin with K99 to run at the right time.

To execute a script at shutdown


 * Put your script in /etc/rc6.d
 * Make it executable (sudo chmod +x myscript)
 * Note: The scripts in this directory are executed in alphabetical order

Thanks - http://en.kioskea.net/faq/3348-ubuntu-executing-a-script-at-startup-and-shutdown

OR

Create your script and make sure you have the BASH shebang line at the top;


 * 1) !/bin/bash

Make your script executable;

chmod a+x scriptname

Copy your script to the main run-level directory;

sudo cp -a -v scriptname /etc/init.d/

Create symbolic links to the shutdown and reboot run-level directories; make sure you have the preceeding K10 in your link name like the examples below; this will make sure it is run first;

sudo ln -s /etc/init.d/scriptname /etc/rc0.d/K10scriptname sudo ln -s /etc/init.d/scriptname /etc/rc6.d/K10scriptname

Open The Additional Drivers Window
sudo software-properties-gtk --open-tab=4

Switch to Root User
Linux Terminal:~$ sudo su - root

Enter the password for the user profile you are in.

Burning a CD with Wodim
Scan for the drive...

wodim --devices wodim: Overview of accessible drives (1 found) : - 0 dev='/dev/scd0'	rwrw-- : 'HL-DT-ST' 'BDDVDRW GGC-H20L' -

or

wodim -scanbus scsibus2: 2,0,0	200) 'HL-DT-ST' 'BDDVDRW GGC-H20L' '1.03' Removable CD-ROM 	2,1,0	201) * 2,2,0	202) * 	2,3,0	203) * 	2,4,0	204) * 	2,5,0	205) * 	2,6,0	206) * 	2,7,0	207) *

What media or type of disc do I have in the drive?

wodim dev=/dev/scd0 -v -atip

Now burn the CD...

wodim dev=/dev/scd0 -v -data cd_image.iso

or

wodim dev=2,0,0 -v -data cd_image.iso

HOWTO: SET: Gnome Theme For New Users
Terminal:~$ sudo nano /usr/share/gconf/defaults/16_ubuntu-artwork

From...

/desktop/gnome/interface/gtk_theme     Ambiance /desktop/gnome/interface/icon_theme    ubuntu-mono-dark /desktop/gnome/peripherals/mouse/cursor_theme  DMZ-White /apps/metacity/general/theme   Ambiance

To... (for example Clearlooks)

/desktop/gnome/interface/gtk_theme     Clearlooks /desktop/gnome/interface/icon_theme    gnome /desktop/gnome/peripherals/mouse/cursor_theme  default /apps/metacity/general/theme   Clearlooks

Save and exit the editor, then run...

Terminal:~$ sudo update-gconf-defaults

Reboot and add a new user to test.

Theme: Have Synaptic Package Manager Use A GTk Theme
If you have set your profile to use a GTk theme when you open the Synaptic Package Manager (SPM) the theme will not be used. This is because essentially it is being run as root so to have it use the theme undertake the following:

Linux Terminal:~$ sudo cp -r /home/username/.themes/your_GTk_theme/ /usr/share/themes/

HOWTO: ALTER: Update Manager Default Behaviour 9.04 onwards
In previous versions of Ubuntu the Update Manager has displayed an icon in the notification area when updates are available. In 9.04/Jaunty this has been replaced by the Update Manager opening a window, if you find this an intrusion there are two methods to revert its behaviour.

Method One:

Terminal:~$ gconftool -s --type bool /apps/update-notifier/auto_launch false

To revert the behaviour:

Terminal:~$ gconftool -s --type bool /apps/update-notifier/auto_launch true

Method Two:

Type 'Alt+F2' to open the run dialogue and enter the following:

gconf-editor

In the right-hand pane navigate to

apps --> update-notifier

In the right-hand pane locate 'auto_launch' and unchecked the tick box.

To revert the behaviour simply repeat the above step, but place a check in the auto_launch box.

HOWTO: FIX: Upgrade Items, The following packages have been kept back
When trying to upgrade the system via the terminal you may receive a message similar to the one below:

Terminal:~$ Reading package lists... Done Building dependency tree Reading state information... Done The following packages have been kept back: banshee banshee-extension-mirage 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

To force the upgrade of the packages that have been held back run the following:

Terminal:~$ sudo aptitude safe-upgrade

Aptitude will need to be installed, currently up to and including 10.04 it comes as standard however from the release of 10.10 it will not be included by default, to install it:

Terminal:~$ sudo apt-get install aptitude

A Package Installed
Terminal:~$ aptitude search pulseaudio | grep ^i

All Packages Installed
Terminal:~$ aptitude search '~i!~M'

What CPU Am I Running?
Terminal:~$ getconf LONG_BIT

or

Terminal:~$ uname -m

or

Terminal:~$ cat /proc/cpuinfo

Thanks - http://www.cyberciti.biz/faq/linux-how-to-find-if-processor-is-64-bit-or-not/

What Files Are In The Package X?
Terminal:~$ apt-file list ffmpeg

or

Terminal:~$ dpkg-query -L ffmpeg

Why A Package Has Been Installed
Linux Terminal:~$

sudo aptitude why

What Package Is That File In?
Terminal:~$ dpkg -S whatever

Example

Terminal:~$ dpkg -S xfce4-terminal xfce4-terminal: /usr/bin/xfce4-terminal

or

Terminal:~$ sudo apt-get install apt-file sudo apt-file update apt-file search whatever

Example

Terminal:~$ which xfce4-terminal /usr/bin/xfce4-terminal apt-file search /usr/bin/xfce4-terminal xfce4-terminal: /usr/bin/xfce4-terminal xfce4-terminal: /usr/bin/xfce4-terminal.wrapper xfce4-terminal-dbg: /usr/lib/debug/usr/bin/xfce4-terminal

Which Version Of A Software Package Am I Running?
Terminal:~$ apt-cache showpkg 

Replace  with the name of the package you are investigating, for example to find the version of OpenVPN:

Terminal:~$ apt-cache showpkg openvpn

Which Version Of Ubuntu Linux Am I Running?
'''Terminal:~$ cat /etc/lsb-release

or

'''Terminal:~$ cat /etc/issue

or

'''Terminal:~$ uname -a && cat /etc/*release

or

'''Terminal:~$ lsb_release -a

or

'''Terminal:~$ hostnamectl

Configuration
https://help.ubuntu.com/11.10/serverguide/C/network-configuration.html

Network Card Reset Naming: How To
After cloning one system to another Ubuntu will see the new PC's network card as 'eth1' as well as retaining the details of the original card. To reset all the network details undertake the following:

Linux Terminal:~$ > /etc/udev/rules.d/70-persistent-net.rules reboot

Change To Static
Terminal:~$ sudo nano /etc/network/interfaces

Edit the file to read (this example uses 192.168.0.100 for the system and Google's DNS servers):

auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1 dns-nameservers 8.8.8.8 8.8.4.4
 * 1) The loopback network interface
 * 1) The primary network interface

Save and close the file, then restart the network:

Terminal:~$ sudo /etc/init.d/networking restart

Edit the 'hosts' file:

Terminal:~$ sudo nano /etc/hosts

Edit the file to read (Desktop used for this example):

127.0.0.1      localhost.localdomain   localhost 192.168.0.100  Desktop.example.com     Desktop ::1    ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
 * 1) The following lines are desirable for IPv6 capable hosts

Then run:

Terminal:~$ sudo echo Desktop.example.com > /etc/hostname sudo /etc/init.d/hostname restart

Check the configuration:

Terminal:~$ hostname hostname -f

Both of the above commands should return:

Desktop.example.com

At this point it is possible to remove Network Manager:

Terminal:~$ sudo gedit /etc/NetworkManager/NetworkManager.conf

Edit the [ifupdown] line to read:

managed=true

Finally remove Network Manager and if you are not using a wireless network card wpasupplicant:

Terminal:~$ sudo apt-get purge network-manager sudo apt-get remove wpasupplicant

Set Static IP Address (11.10 onwards)
Fish

eth0 Missing With NFS Mount
http://www.cyberciti.biz/faq/setting-up-an-network-interfaces-file/

/etc/network/interfaces

auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp

PulseAudio From Auto Starting
pulseaudio is a stubborn little daemon. man pulseaudio says you can turn it off with the command pulseaudio --kill. But it won't stay killed-- it respawns itself. There is a normal init script to start it at boot, /etc/rc2.d/S50pulseaudio. But when you try controlling this the normal Linux way it doesn't work, because running /etc/init.d/pulseaudio stop doesn't stop it. Removing /etc/rc2.d/S50pulseaudio doesn't prevent it from starting at boot.

To stop its respawning habit, open /etc/pulse/client.conf, change autospawn = yes to autospawn = no, and set daemon-binary to /bin/true. Make sure these lines are uncommented, like this:

autospawn = no daemon-binary = /bin/true

Login Sound
 Method One  Terminal:~$ sudo -u gdm gconftool-2 --set /desktop/gnome/sound/event_sounds --type bool false

 Method Two 

System --> Preferences --> Startup Applications --> Startup Programs (tab)

Locate and untick 'GNOME Login Sound' entry

HOWTO: ALSA + NVIDIA + ION + HDMI
Unmute all the S/PDIF + S/PDIF Default + S/PDIF 1.

Terminal:~$ alsamixer

Test to make sure your hardware works first.

Terminal:~$ aplay -D plughw:0,3 /usr/share/sounds/alsa/Noise.wav

Add the following contents to the file /etc/asound.conf.

pcm.!default { type plug slave.pcm { type hw card 0 device 3 } }

Retest it with the following command.

Terminal:~$ aplay /usr/share/sounds/alsa/Noise.wav

Sound Menu Default Player
To add media players to the Ubuntu sound menu do:

Terminal:~$ gsettings set com.canonical.indicator.sound interested-media-players “['media_player']“

To remove media players from the Ubuntu sound menu do:

Terminal:~$ gsettings set com.canonical.indicator.sound blacklisted-media-players “['media_player']“

Replace 'media_player' with the programme you want to add.

Examples:

Rhythmbox:

Terminal:~$ gsettings set com.canonical.indicator.sound interested-media-players "['rhythmbox']"

VLC:

Terminal:~$ gsettings set com.canonical.indicator.sound interested-media-players "['vlc']"

Banshee:

Terminal:~$ gsettings set com.canonical.indicator.sound interested-media-players "['banshee']"

Domain
http://www.markwilson.co.uk/blog/2007/05/using-active-directory-to-authenticate-users-on-a-linux-computer.htm