Вы находитесь на странице: 1из 13

General Ubuntu

Print screen
- Use Ubuntu Unity feature
+ press PrintScreen key to capture the whole screen
+ press alt-printscreen to capture the current active window
- Use Screenshot app
+ Search for “screenshot”
→ can specify delay time before it takes a pic
- Install additional program: “Shutter”

HUD (Head-Up Display) Feature (in Ubuntu 12.04)


- Press alt key when you are in a particular application. Then enter that app-specific commands that you
wanna use

Trash folder
- The trash folder is found at: /home/username/.local/share/Trash
- If you deleted something as root (e.g. deleted a file using Nautilus invoked via gksu), it's at:
/root/.local/share/Trash
- Folder which contains deleted files is /home/username/.local/share/Trash/files

Change default application


change default app in Ubuntu for web, mail, video, ...
• system settings / details / default applications
change default app for specific file types. There are 2 different ways:
• r.click that file (for ex: PDF) properties / open with / select the default app
• OR, we can install “Ubuntu Tweak” app:
◦ Add the repository “sudo add-apt-repository ppa:tualatrix/ppa”
◦ run the command “sudo apt-get update”
◦ run "ubuntu software center", search for "ubuntu tweak"
◦ Open the app, click Admin tab, then click “file type manager”
◦ ….....

Working with Terminal


- Open terminal:
+ method 1: alt+f2, then type gnome-terminal (perhaps work only with gnome)
+ method 2: ctrl+alt+T (work with Ubuntu GNOME only)
Checking Ubuntu version

Ubuntu 12.04
- system tools / system settings / details

All Ubuntu
- Use the command:
+ lsb_release -a
If that command doesn't work, try this:
• cat /etc/lsb-release (lsb: linux standard base)

Error Reporting

Editing a file
$ sudo vi /etc/default/apport
Change enabled=0 to enabled=1 so that Ubuntu will report errors (enabled=1 is the default value)

Using GUI
System settings / privacy / diagnostics – check or uncheck “send error reports to canonical”

Keyboard Shortcuts
Useful shortcuts
ctrl + alt + del: logout
ctrl + alt + L: lock
ctrl + alt + t : open a terminal

How to configure shortcuts


Keyboard shortcuts for the system are here:
• system settings / keyboard / shortcuts
◦ Navigation:
▪ Hide all normal windows (~ show desktop): ctrl + super + D (super is the windows key)

Ubuntu GNOME mode


For Ubuntu 14.04, to switch to the classic mode:
• Install GNOME Flashback. Log out of current session, then select the classic mode
• At the classic mode, can't use “alt + tab” → follow steps:
◦ Install “compizconfig-settings-manager”
◦ Install its plugin by “sudo apt-get install compiz-plugins”→ open it → window management
→ check “application switcher”

Change Ubuntu hostname


To change permanently, edit these 2 files:
• sudo gedit /etc/hostname /etc/hosts
• Restart

Disable animations
Install CompizConfig Settings Manager first
Open the program:
• Effects: either tick or untick animations -> enable/disable the whole animation setting
• Select animation to customise:
◦ minimize animation -> enter 50 (minimum value)
◦ open animation (when opening an app): glide 2 -> enter 50
◦ unminimize animation -> 50
◦ close animation -> 50

Ubuntu battery
Open dconf-editor
Browse to org -> gnome -> settings-daemon -> plugins -> power

• percentage-critical: the value considered to be critical for the system


• percentage-action: the percentage value at which the critical action is performed.
• critical-battery-action
• Change use-time-for-policy to false (uncheck this option. Then, the system won't use the time
remaining as the criteria. It will be forced to use the percentage remaining)

Enable Hibernation function


For Ubuntu 14.04, hibernation is missing (only suspend is available). 2 ways to solve this:
• open terminal, & use this command to hibernate the laptop:
◦ sudo pm-hibernate
• Or, type the following commands in a terminal:
◦ sudo -i
◦ cd /var/lib/polkit-1/localauthority/50-local.d/
◦ gedit com.ubuntu.enable-hibernate.pkla
◦ copy & paste the followings into the file *.pkla above:
▪ [Re-enable hibernate by default in upower]
▪ Identity=unix-user:*
▪ Action=org.freedesktop.upower.hibernate
▪ ResultActive=yes

▪ [Re-enable hibernate by default in logind]
▪ Identity=unix-user:*
▪ Action=org.freedesktop.login1.hibernate
▪ ResultActive=yes
◦ log out & log back in

Executable text files


To specify whether to display or run an executable text file when it's opened, follow this:
• Open nautilus (file manager) / edit / preferences / behavior / choose one out of 3 options

Ubuntu system
System Monitor
- system tools / system monitor (or $gnome-system-monitor)
- system tools / task manager

System settings
Date and time
(1,31)
Software clock – Hardware clock

Appearance
Automatically Hide Unity Launcher
- In Ubuntu 12.04:
+ Click the button at top right corner / system settings / appearance
+ Choose behavior tab, click the button to turn it on
Tweak app menus
In Ubuntu 16.04:
• choose where app menus appear:
◦ Go to System Settings > Appearance
◦ Select the Behavior tab
◦ Find the section headed: Show the Menus for a Window
◦ Check (click) the circle next to In the windows title bar
• To make application menus "always show":
◦ Go to System Settings > Appearance
◦ Select the Behavior tab
◦ Find the section headed: Menus visibility
◦ Check (click) the circle next to Always displayed
Move the Unity launcher
Ubuntu 16.04:
• To move the Unity Launcher to the bottom:
◦ gsettings set com.canonical.Unity.Launcher launcher-position Bottom

Text Entry
check or uncheck "show current input source in the menu bar" (similar to language bar on windows
system)

System configuration
Dconf-editor vs gconf-editor
• dconf is a new way for applications to store settings, and it is intended to replace gconf.

System startup
Boot arguments
Cat /proc/cmdline

• shows the parameters passed to the kernel at the time it is started

Run level
Check previous and current runlevel:
# runlevel

Services
- init process is in /sbin/init. It manages jobs defined in /etc/init/ directory:
+ gdm.conf
+ lightdm.conf
+ shutdown.conf
- Some of the ways to enable/disable services:
+ Terminal
+ GNOME GUI
Terminal
1. Using update-rc.d : install & remove System-V style init script
(I think this is the old way although I haven't verified this yet)
2. Pass a script file start/stop/restart: this will start/stop services temporarily
$ sudo /etc/init.d/xinetd status
When we run that command, it says “Rather than invoking init scripts through /etc/init.d, use
the service(8) utility, e.g. service xinetd status
Since the script you are attempting to invoke has been converted to an Upstart job, you may
also use the status(8) utility, e.g. status xinetd”

It means we should use this method instead:


$ sudo service xinetd status
And if a script has been already converted to an Upstart job (not all jobs are converted), we can
use this:
$ sudo status xinetd
If we use the above method to a job which has yet been converted, we will get the message:
“Unknown job: ...”

GUI tools
Startup applications
- We can either run this command on a terminal to start the GUI,
$ gnome-session-properties
(this tool is of GNOME project)
OR Applications/System Tools/Preferences/Startup Applications
(note that not all services appear here, commonly only the ones that involve a system tray icon or GUI
windows)

Boot up manager
- Install boot up manager:
+ sudo apt-get install bum
- Run bum (it has to be run as root):
+ sudo bum
(I think this one doesn't work very well)

References
http://upstart.ubuntu.com/cookbook/ (upstart cookbook)
Linux Kernel
Device Driver

Installing
Method 1
The following instructions will help to install NVIDIA Geforce Driver for this HP laptop
- Download the file “NVIDIA-Linux-x86-xxx.x.run” from NVIDIA website
- Press ctrl-alt-F1 to go to the console
- Stop X server temporarily:
# sudo stop lightdm
(OR #sudo service lightdm stop )
- Get to the directory containing the file, and type (as root):
# sudo sh ./ NVIDIA-Linux-x86-xxx.x.run
- During installation process, NVIDIA will create a backup of X server configuration.
- After the installation is finished, restart the computer:
# shutdown -r now
- After restarting, if windows can't login to GUI interface (perhaps the error is “API error: versions
mismatch”), we can uninstall NVIDIA driver by:
# sudo ./NVIDIA-Linux-x86-xxx.x.run - -uninstall
→ NVIDIA will automatically restore the previously backup file

Method 2
- We can also install from a 3rd-party source by opening the terminal:
# sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
# sudo apt-get update
# sudo apt-get install nvidia-current
(x-swat means “stable drivers”)

- Homepage is here:
https://launchpad.net/ubuntu/+ppas
(PPA stands for Personal Package Archives)

- A ppa is a package bundle provided by 3rd party (meaning any other than Ubuntu official). Adding a
ppa and installing an app/driver from it means you will be receiving updates for them when the ppa
owner updates a page

Checking
- If the installation is successful, we can check NVIDIA X Server setting by searching for “NVIDIA X
Server Settings”
- OR, check by running this command
# glxinfo | grep OpenGL
- For Ubuntu 14.04, check which driver is being used for X:
• lspci -vnn | grep -i VGA -A 12
Managing Software
Using dpkg

Using apt-get
- apt-get help
- sudo apt-get remove application
+ The package is removed whereas the configuration files are left intact
- sudo apt-get purge application
+ The package & also the configuration files are remove
- sudo apt-get remove --purge application
+ same as “sudo apt-get purge application”
- sudo apt-get autoremove
- sudo apt-get update
+ The APT package index is essentially a database of available packages from the repositories
defined in the /etc/apt/sources.list file. Use this command to update the local package index
with the latest changes made in repositories
- apt-get actions are logged at /var/log/dpkg.log

Using apt-cache
- used to search for an app
$ apt-cache search dropbox

Using aptitude
(1,25)
Same as apt-get, but …

Using GUI tools


- Muon
- Synaptic

Updating Ubuntu system

Command line
$ sudo apt-get update
$ sudo apt-get upgrade || $ sudo apt-get dist-upgrade
Differences bet $sudo apt-get upgrade & $sudo apt-get dist-upgrade (check man page or in (1,25))
GUI
- Run “Update Manager”
- Then, check for update

Upgrading Ubuntu system


Command line
$ sudo do-release-upgrade
OR
$ sudo apt-get dist-upgrade
- For differences between “apt-get upgrade” and “apt-get dist-upgrade”, read the man page of apt-get
(it's very clear)
- apt-get dist-upgrade will only change you from one release to another if you've modified
/etc/apt/sources.list to point to a newer release, but this method of upgrading is not recommended.
Using do-release-upgrade is recommended because it has the ability to handle system configuration
changes sometimes needed between releases
- It is also possible to use do-release-upgrade to upgrade to a development version of Ubuntu
$ do-release-upgrade -d
(however, upgrading to a development release is not recommended for production environments)

GUI
- Run “Update Manager” / settings / updates tab
- At “notify me of a new Ubuntu version”, we have some choices:
+ For any new versions
+ For LTS versions
+ Never
- If we choose “For any new versions”, then we can upgrade the system to a newer one even though
that version is not a LTS version.

Users and Groups


Disable guest session

- A guest session is a user account which can log on to the Ubuntu system without the need to enter
password information. To secure the system, we need to disable this.
- sudo gedit /etc/lightdm/lightdm.conf
- add this line at the end, below "user-session=ubuntu"
allow-guest = false
→ guest can't log on to the system anymore
File system
Check the partition table:
# sudo fdisk -l

Linux Ownership & Permissions


Root Powers (sudo command)
(1,21)
Change to root privilege (root prompt) in a terminal:
# sudo -i

The X Windows System


X concepts
(1,36,37)
X directories:
• /usr/bin
• /usr/include
• ...

Display Manager
- Ubuntu 11.10 introduces a new display manager, so we need to configure this file:
+ vi /etc/lightdm/lightdm.conf
- How to restart the display manager (without rebooting):
+ sudo restart lightdm
+ sudo service lightdm restart

X configuration file
X configuration file location:
• /etc/X11/xorg.conf

Networking
Interfaces
https://help.ubuntu.com/10.04/serverguide/network-configuration.html
Telnet

Installing Telnet Server


- Install telnet server from inetd service:
+ sudo apt-get install telnetd
- Install from xinetd service:
+ sudo apt-get install xinetd
+ sudo apt-get install telnetd
OR make it in one line:
+ sudo apt-get install xinetd telnetd

Working with telnet server


- inetd service:
+ sudo service openbsd-inetd restart, OR
+ sudo /etc/init.d/openbsd-inetd restart
- xinetd service:
+ although we installed xinetd first, the telnet Internet services daemon for telnet was still
openbsd-inetd
+ The telnet server of Fedora distribution is located at /etc/xinetd.d/telnet, and the name of the
package is telnet-server

SSH
- Install SSH:
+ sudo apt-get install openssh-server
- SSH server:
+ Configuration file for SSH server:
* /etc/ssh/sshd_config
+ SSH service:
* sudo service ssh status/start/stop/restart
- SSH client:
+ Configuration file for SSH client:
* /etc/ssh/ssh_config

FIREWALL
https://help.ubuntu.com/12.04/serverguide/firewall.html
https://wiki.ubuntu.com/UncomplicatedFirewall
- Ubuntu built-in firewall is ufw (uncomplicated firewall)
- By default ufw is disabled
- Commands to work with:
+ sudo ufw disable
+ sudo ufw enable
+ sudo ufw status

Applications for Ubuntu


1. chromium-browser
$ sudo apt-get install chromium-browser
$ chromium-browser
To install adobe flash player for chromium, install this using “ubuntu software center”: pepper flash
player
2. guake terminal
A drop-down terminal for GNOME environment.
$ guake
(press F12 for it to appear, press again to hide it)
3. Wine Windows Program Loader
Wine is a compatible layer for running Windows apps on Linux
4. Psensor
Temperature utility for Linux (Ubuntu)
5. Golden Dictionary
6. qpdfview
pdf viewer app
7. vlc media player
A very good media player app

Troubleshooting
General
(1,20)
dmesg or /var/log/messages

Ubuntu gets frozen


The whole screen gets frozen, only the mouse can be moved.
To solve this problem, logging into 1 of the virtual desktops (ctrl+alt+f2(or 3-6)), then enter
# sudo stop lightdm
# sudo start lightdm

Ubuntu 12.04 not turned off when shutting down


The problem may be related to either NVIDIA or ACPI. Here is the solution:
• sudo -i (to get a root shell, sudo gedit is not recommended)
• gedit /etc/default/grub
• Find the line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
• Change this to: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force"
• Save the file and close the file.
• Finally, in terminal: update-grub
• exit (to end the root shell)
After updating the system, if the problem reappears, do the above config again.

Blueman crashes (bluetooth manager)


Remove it using synaptic package manager

REFERENCES
1. Ubuntu Unleased (2012 edition)
2.

Вам также может понравиться