Difference between revisions of "Ubuntu Customization"

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search
(Disable Alt-Tab Window Grouping)
m
 
(11 intermediate revisions by 2 users not shown)
Line 24: Line 24:
  
 
For more information see: [[Windows network share integration for linux]] - discussion of methods available.  Includes an fstab example providing full read/write access to network share.
 
For more information see: [[Windows network share integration for linux]] - discussion of methods available.  Includes an fstab example providing full read/write access to network share.
 +
 +
Error: mount: wrong fs type, bad option, bad superblock on
 +
*You need to install cifs-utils
 +
sudo apt-get install cifs-utils
 +
Error: mount error: could not resolve address for xxxxx: Unknown error
 +
*You need to add an entry for the server host in /etc/hosts
 +
sudo vi /etc/hosts
 +
192.168.X.X xxxxx xxxxx.domain.com
 +
 +
Error: mount error(13) permission denied
 +
#Check to make sure you are using the correct username password combination
 +
#Check the uid to ensure it matches with the username
  
 
=== Numlock On by Default ===
 
=== Numlock On by Default ===
Line 41: Line 53:
  
 
  apt-get install pcmanfm
 
  apt-get install pcmanfm
 +
 +
=== Wimamp like audio player lightweight fast ===
 +
We used to install xmms, however, it has been removed from the respositories since the Gutsy Gibbon release.  Another alternative which is easy to install and has been included in newer releases of Ubuntu is qmmp
 +
 +
apt install qmmp
 +
 +
Run as sudo or root.  Some versions may require adding repository.  See: [[Multimedia_Audio_and_Video_in_Linux#qmmp|qmmp]] under the Multimedia Audio and Video in Linux entry.
 +
* note: I had problems getting qmmp to play ogg files without adding a 3rd pty repository to update to the latest version along with addons.
  
 
=== IP Network Configuration (GUI - Network Manager) ===
 
=== IP Network Configuration (GUI - Network Manager) ===
Line 88: Line 108:
 
To connect to remote machines you will need to install xtightvncviewer.
 
To connect to remote machines you will need to install xtightvncviewer.
 
  sudo apt install xtightvncviewer
 
  sudo apt install xtightvncviewer
however, it does not support scaling on linux.  A more sophisticated viewer is "vinagre".
+
however, it does not support scaling on linux.  A more sophisticated viewer is "[[vinagre]]".
 
  sudo apt install vinagre
 
  sudo apt install vinagre
It used to be the default viewer in older versions of Ubuntu.  It has been replaced by a worthless piece of junk called Remmina.  For vnc the vinagre viewer is great and supports screen scaling.
+
It used to be the default viewer in older versions of Ubuntu.  It has been replaced by a worthless piece of junk called Remmina.  For vnc the [[vinagre]] viewer is great and supports screen scaling.
 +
 
 +
note: The program vinagre is displayed as "Remote Desktop Viewer" in the desktop environment.  After you install vinagre look for Remote Desktop Viewer in the menu.
  
 
=== Enable Other Package Repositories ===
 
=== Enable Other Package Repositories ===
Line 176: Line 198:
 
*Go to Brightness & Lock panel from the Unity Launcher. And set Turn screen off when inactive: to Never
 
*Go to Brightness & Lock panel from the Unity Launcher. And set Turn screen off when inactive: to Never
 
*Install "Unity Tweak Tool" with sudo apt-get install unity-tweak-tool. Run it from the Launcher and select System > Security > Enhance system security by disabling Desktop lock
 
*Install "Unity Tweak Tool" with sudo apt-get install unity-tweak-tool. Run it from the Launcher and select System > Security > Enhance system security by disabling Desktop lock
 +
 +
===turn off screensaver and power-management===
 +
Use the "screen" or "brightness and lock" application.  Click on the Unity Search and type "Brightness & Lock"
 +
 +
In the "Brightness & Lock" interface disable "Dim screen to save power" and set "Turn screen off when inactive for: Never"
 +
 +
You might find that the above solution is necessary, but not sufficient. The screen might still be blanking after 10 minutes. This is a default setting compiled into Xorg.
 +
 +
To disabled it for the current session, run:
 +
xset s off
 +
 +
You can put this in your .xsession file to disable it upon every login.
  
 
=== Coping with Mac styled Global Application Menus ===
 
=== Coping with Mac styled Global Application Menus ===
Line 211: Line 245:
 
  sudo apt install compizconfig-settings-manager compiz-plugins-extra
 
  sudo apt install compizconfig-settings-manager compiz-plugins-extra
  
In this manager, find the Ubuntu Unity Plugin, go to tab "Switcher" and disable all short cuts and check boxes
+
In this manager, find the Ubuntu Unity Plugin, go to tab "Switcher" and disable it.  You will be disabling the switcher plugin.  Some recommend unchecking all of the boxes within the switcher settings.
  
 
Click the back button.  Now search for "Static Application Switcher" and enable that.
 
Click the back button.  Now search for "Static Application Switcher" and enable that.

Latest revision as of 08:27, 21 June 2019

Ubuntulogo150x173x256.png

Many customizations will use The apt-get Package Management Tool to install applications or servers to the system. Others will require editing system files. Know your Ubuntu version 'lsb_release -a' for package availability and compatibility.

Secure Shell Support for Remote Login

If the ssh server is not already installed, we will use apt-get to install. As root or using sudo do the following:

apt-get install openssh-server openssh-client 
service ssh start

Note: Added 10/17/2016 old cyphers no longer configured, may cause connection problems with legacy ssh clients such as SecureCRT. ref: https://blog.hqcodeshop.fi/archives/245-SSH-connection-fails.html

Add new user to system

As root or using sudo do the following

useradd -c "Nicole Ploof" -m -s /bin/bash nicolep
passwd nicolep
passwd -u nicolep

The first line creates a new user account on the system, using the next available UID for users and creates a home directory /home/nicolep with the default shell bash assigned. The next line prompts you to set a password for user nicolep and the last line ensures the login is unlocked. Substitute nicolep for the username of your choice as well as -c comments in quotes for the first and last name of your choice.

Mount some shares from a Windows machine or SMB NAS

Development of seamless windows network share integration for linux in some respects has been, over the many years, very disappointing. There are basically a couple well known approaches. First, use the "Browse Network" from nautilus file manager for temporary access after providing your username and password for the windows share, or secondly, hard coding your username and password along with the network path in /etc/fstab for a persistent share available on boot.

fstab example: persistent mounts using exposed credentials

There are more than one ways to do this. This example uses cifs to permanently mount the shares so that they will be available after reboot. If the system complains add the 'noauto' parameter.

  • First edit your /etc/hosts file and add the hostname and IP address of the windows share or file server
  • Next create mount points in /mnt for each windows share
  • Make sure you have cifs installed
  • Edit /etc/fstab and add a line for each windows share, see examples:
//apollo/public/ /mnt/public cifs username=nicolep,password=yourpass,iocharset=utf8,sec=ntlm  0  0
//apollo/media/ /mnt/media cifs username=nicolep,password=yourpass,iocharset=utf8,sec=ntlm  0  0
//apollo/video/ /mnt/video cifs username=nicolep,password=yourpass,iocharset=utf8,sec=ntlm  0  0
  • mount the shares
mount -a
  • This provides read-only access to the network shares.

Example with file permission specified and full rw access

//apollo/public /mnt/public cifs defaults,dir_mode=0777,file_mode=0777,domain=workgroup,username=nicolep,password=yourpass,uid=1000

troubleshooting: devs keep breaking samba

KERNEL CHANGE BREAKS CIFS.

Somewhere between kernel 4.10.0-38 4.15.0-20 a change was made that COULD PREVENT your cifs shares from mounting. Kernels at and before 4.10 used SMB (Server Message Block) version 1.0 as the default if not specified. Most folks did not specify it so it defaulted to 1.0 and worked. Microsoft ditched 1.0 in Windows 10 and dropped support. Linux kernel developers decided to change the kernel code to no longer default to SMB 1.0 and now default to a newer version. For people that are using legacy networks or NAS devices, it breaks the mounting example from above.

Solution: Specify the SMB version.

The solution is to tell mount.cifs to use the SMB2, SMB2.1 or SMB3.0 protocol using the "vers" parameter. in Linux CIFS Utils and Samba Specify 1.0, 2.0, 2.1, or 3.0.

For the following full line example a linux desktop is connecting to an older NAS device. It is necessary to specify SMB version 1.0. Example:

//apollo/video/ /mnt/video cifs defaults,vers=1.0,domain=workgroup,username=nicolep,password=mythtv,iocharset=utf8,sec=ntlm 0 0

FAILED TO CLOSE BROKEN PIPE

Update 2024 Kernel 5.15 Samba 2:4.15.13+dfsg-0ubuntu1.6 -

cp: failed to close 'filename': Broken pipe

A problem with this latest at the time samba Can't copy large files to Windows share - Error closing file: Input/output error issue workaround, specify prior version of cifs on fstab, see example:

//apollo/video/ /mnt/video cifs vers=2.0,defaults,domain=workgroup,username=nicolep,password=yourpass,uid=1000

For more information see: Windows network share integration for linux - discussion of methods available. Includes an fstab example providing full read/write access to network share.

Error: mount: wrong fs type, bad option, bad superblock on

  • You need to install cifs-utils
sudo apt-get install cifs-utils

Error: mount error: could not resolve address for xxxxx: Unknown error

  • You need to add an entry for the server host in /etc/hosts
sudo vi /etc/hosts
192.168.X.X		xxxxx	xxxxx.domain.com

Error: mount error(13) permission denied

  1. Check to make sure you are using the correct username password combination
  2. Check the uid to ensure it matches with the username

Numlock On by Default

Double Click to Launch

Restore the Classic Menu that's missing from Unity

How to Install and Launch the Classic Gnome Menu in Ubuntu 14.04

Ubuntu may seem completely different from what it used to be due to the new Unity Desktop for GNOME. The GNOME Classic Menu in Ubuntu is missing, it has been replaced by Unity with its crashy "Dashboard" where you find your applications by clicking "Dashboard Home" and hoping it doesn't trigger the notorious and unresolved GPU Freeze loop. To get the classic menu back without switching to GNOME desktop you can install classicmenu-indicator for Unity desktop. Like the classic GNOME Menu, it includes all the applications and structure of the classic menu. It’s easy to navigate and access applications for those who are used to it.

As root or using sudo do the following:

apt-add-repository ppa:diesch/testing
apt-get update
apt-get install classicmenu-indicator

After installing it, go and launch the application from Unity Dash. It’s called Classic Menu Indicator. When you launch it, it will automatically dock at the top panel over towards the right side. It should be just left of the speaker or clock. It will look like three horizontal bars.

Fast Light File Manager Nautilus Replacement

PCMan File Manager (PCManFM) is meant to be a replacement for Nautilus, Konqueror and Thunar. PCManFM is the standard file manager in LXDE.

apt-get install pcmanfm

Wimamp like audio player lightweight fast

We used to install xmms, however, it has been removed from the respositories since the Gutsy Gibbon release. Another alternative which is easy to install and has been included in newer releases of Ubuntu is qmmp

apt install qmmp

Run as sudo or root. Some versions may require adding repository. See: qmmp under the Multimedia Audio and Video in Linux entry.

  • note: I had problems getting qmmp to play ogg files without adding a 3rd pty repository to update to the latest version along with addons.

IP Network Configuration (GUI - Network Manager)

Network Manager is a GUI interface used to configure networking on most modern desktop Linux systems including Ubuntu and Fedora.

  • In xfce you can go to the APPLICATIONS menu and choose SETTINGS, NETWORK CONNECTIONS.
  • In Gnome / Unity you can go to the Network icon in the Application Indicator (updown arrow icon) typically top right of the screen and then click Edit Connections.

Once the Network Connections dialog is open, select the interface you want to configure, and then click Edit, select the IPv4 Settings tab. Enter the network settings here.

  • Instead of a netmask of 255.255.255.0 for a typical Class C LAN, you can enter the number "24" for the Netmask.

When a static IP address is configured via the graphical Network Connections utility, the setting is saved to the following path

/etc/NetworkManager/system-connections/

To change the settings from console without creating a conflict in settings location you can edit the file

vi /etc/NetworkManager/system-connections/Wired connection 1

The file isn't meant to be edited by the user (CLI - Command Line Interface), but by the Network Manager tools.

nmcli is a tool that allows NetworkManager management from command line.

IP Network Configuration (Console)

When configuring IP networking using the GUI interface "Network Manager" settings are stored differently than when configuring via traditional CLI (Command Line Interface). This is a design often criticized for the confusion it can create. The administrator can choose to disable Network Manager and use the traditional Debian etc/network/interfaces file.

On a headless console only system the use of Network Manager would not make sense. It can be disabled and the traditional CLI method may be used. To disable Network Manager do the following as 'root' or use the sudo command.

service network-manager stop
echo "manual" | tee /etc/init/network-manager.override 

More on disabling "Network Manager" can be found on this external source: How to disable Network Manager on Linux

install configure vncserver

Install the vnc server

apt-get install vnc4server

Or if you prefer TightVNC

apt-get install tightvncserver

You need to set a default password. Do this from console

vncserver

Enter and verify the password of your choice.

Note: This requires a local user to be logged into a desktop session before a remote client can connect. It is also possible to make vncserver start as a system service. See the following guide on this wiki:

To connect to remote machines you will need to install xtightvncviewer.

sudo apt install xtightvncviewer

however, it does not support scaling on linux. A more sophisticated viewer is "vinagre".

sudo apt install vinagre

It used to be the default viewer in older versions of Ubuntu. It has been replaced by a worthless piece of junk called Remmina. For vnc the vinagre viewer is great and supports screen scaling.

note: The program vinagre is displayed as "Remote Desktop Viewer" in the desktop environment. After you install vinagre look for Remote Desktop Viewer in the menu.

Enable Other Package Repositories

Ubuntu uses apt for package management. Apt stores a list of repositories, which are places with collections of software packages, in a text file. This file can be edited from the command line with root privilege or sudo.

vi /etc/apt/sources.list
apt-get update

Removing the # in front of repositories, such as "deb http://archive.canonical.com/ubuntu saucy partner" will allow access to those packages. Running "apt-get update" is necessary after making changes to the file. 3rd party repositories can also be manually added to the text file.

Install or Update the Flash Plugin Package

Adobe Flash Player 11.2 was released in 2012 was the last version Adobe plans to release to the Linux community with the exception of limited security related updates. To update Flash or install simply use apt-get

apt-get install adobe-flashplugin

If you experience problems please refer to our complete guide to Install Update Flash Plugin Ubuntu.

Persistent Path Environment Variable

  • Bash as login shell will load /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile in the order
  • Bash as non-login interactive shell will load ~/.bashrc
  • Bash as non-login non-interactive shell will load the configuration specified in environment variable $BASH_ENV

The Ubuntu desktop session is no longer affected by .profile. Additionally bash doesn't parse .profile if either .bash_profile or .bash_login exists.

A path set in .bash_profile will only be set in a bash login shell (bash -l). If you put your path in .profile it will be available to your complete desktop session.

To add a directory to your, or a specific user's $PATH, edit ~/.profile

vi ~/.profile

To make the change persist

PATH="$HOME/bin:$PATH"

and change it to:

PATH="$HOME/bin:$PATH:/foo"

to make the change immediate for your session

export PATH=$PATH:/foo
  • /etc/environment - This file is specifically meant for system-wide environment variable settings.
  • /etc/.profile - This file gets executed whenever a bash login shell is entered

To set a persistent path for all users on the system, edit the /etc/environment file.

blacklisting a kernel module at boot

There maybe a time when you need to disable some modules from being loaded during your system's boot time. In this "how to" we will discus some of the few ways how to blacklist module including its dependencies, that is, disable permanently module from loading during the boot time. Source: How to blacklist a module on Ubuntu/Debian Linux

In a quick example, if you wish to disable the sound generated by the PC speaker, do the following:

vi /etc/modprobe.d

Then add the following:

blacklist snd_pcsp

Now the module snd_pcsp will not be loaded when you reboot. No more sound from the PC speaker. beep will be silent. To enable the module once again you can simply remark it by placing a # in front and reboot.

changing your default console editor

Ubuntu default text editor seems to be "nano" which is a pico style text editor. It is for DOS people (because it is like the old MSDOS6 DOS EDIT.) DOS SUCKS.

Type:

sudo update-alternatives --config editor

You will get a text like below.

There are 4 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
------------------------------------------------------------
* 0            /bin/nano            40        auto mode
  1            /bin/ed             -100       manual mode
  2            /bin/nano            40        manual mode
  3            /usr/bin/vim.basic   30        manual mode
  4            /usr/bin/vim.tiny    10        manual mode 

Press enter to keep the current choice[*], or type selection number: 3

run the following:

export EDITOR=vim

To make it permanent, add this line to ~/.profile

export EDITOR=vim

Unity Tweak Tool

Unity Tweak Tool offers 20 different customization options under 4 categories.

Installation:

sudo apt-get install unity-tweak-tool gnome-tweak-tool

Once you have installed Unity tool, type “Unity” (without quotes) in Dash and click on the Unity Tweak Tools icon.

Disable Screen Lock

There is two steps involved into completely disabling the lock screen in Unity.

  • Go to Brightness & Lock panel from the Unity Launcher. And set Turn screen off when inactive: to Never
  • Install "Unity Tweak Tool" with sudo apt-get install unity-tweak-tool. Run it from the Launcher and select System > Security > Enhance system security by disabling Desktop lock

turn off screensaver and power-management

Use the "screen" or "brightness and lock" application. Click on the Unity Search and type "Brightness & Lock"

In the "Brightness & Lock" interface disable "Dim screen to save power" and set "Turn screen off when inactive for: Never"

You might find that the above solution is necessary, but not sufficient. The screen might still be blanking after 10 minutes. This is a default setting compiled into Xorg.

To disabled it for the current session, run:

xset s off

You can put this in your .xsession file to disable it upon every login.

Coping with Mac styled Global Application Menus

The AppMenu (Global Menu) - Unity's Global Menu - 14.04

Change the global menu to show in the windows title bar (all apps)

  • System -> Appearance -> click on the "Behavior" tab. Select the radio box for "In the window's title bar."

Once clicked, the application menus appear within the window decoration inline with the menu buttons. This isn't exactly a complete fix but is preferred to the auto-hide behavior that is default. The command line alternatives:

gsettings set com.canonical.Unity integrated-menus true

and

gsettings set com.canonical.Unity integrated-menus false

You can also completely cripple and disable Mac like menus by removing the offending package.

sudo apt-get remove indicator-appmenu

Warning, removing indicator-appmenu will cripple Dash. It is said to disable HUD? In a practical sense the crippling may go unnoticed by some users. After removing indicator-appmenu you may not miss a thing! It won't hurt to try, you can always put it back. You need to reboot after removal to experience the changes.

Test: after removal of indicator-appmenu and a reboot, the HUD service was still running.

2159 ?        Ss     0:00 /usr/lib/x86_64-linux-gnu/hud/window-stack-bridge
2243 ?        Ssl    0:00 /usr/lib/x86_64-linux-gnu/hud/hud-service

Furthermore, Global Menu was completely gone! Now menus are back where they are supposed to be, on the application window! Tested successful on Ubuntu 14.04.

Unity Launcher Customization

The Unity Launcher bar is on the left side of the desktop screen. It cannot be moved. It can be hidden or set to automatically hide itself. It cannot be moved to the right side or anywhere else, which is by design.

/etc/resolv.conf gets overwritten

This should be titled reslov.conf gets overwritten and modification to the DNS name server settings in the GUI is broken too.

Preliminary testing: completely delete /etc/resolv.conf, reboot, create a new resolv.conf, add the nameserver, execute the command chattr +i /etc/resolv.conf

This procedure is not yet verified. It is necessary to delete resolv.conf and reboot in order to use the chattr command.

Disable Alt-Tab Window Grouping

Install the compizconfig-settings-manager using apt-get:

sudo apt install compizconfig-settings-manager compiz-plugins-extra

In this manager, find the Ubuntu Unity Plugin, go to tab "Switcher" and disable it. You will be disabling the switcher plugin. Some recommend unchecking all of the boxes within the switcher settings.

Click the back button. Now search for "Static Application Switcher" and enable that.

Enable its key combinations for next and previous windows Alt+Tab and Shift+Alt+Tab.