Ubuntu: Difference between revisions
Line 40: | Line 40: | ||
gpg --export A8267963484B044F | sudo apt-key add - |
gpg --export A8267963484B044F | sudo apt-key add - |
||
</source> |
</source> |
||
;Old releases |
|||
* <tt>http://old-releases.ubuntu.com/ubuntu/</tt> |
|||
Other repositories: |
Other repositories: |
Revision as of 00:06, 7 February 2015
This page is dedicated to the Ubuntu Linux distribution or derivatives
References
- Ubuntu Documentation
The same documentation is also available in Gnome / KDE Help- Ubuntu Server Guide - Ubuntu 10.04 LTS (or Help → Advanced Topics → Ubuntu Server Guide)
Gold mine of information on how to run a server with Ubuntu (firewall setup, mail server, VCS setup...)
- Ubuntu Server Guide - Ubuntu 10.04 LTS (or Help → Advanced Topics → Ubuntu Server Guide)
Repositories
- Ubuntu Repositories — Examples for Lucid distribution:
#Stable repository
deb http://be.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
deb-src http://be.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse
#Distribution security updates
deb http://be.archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse
deb-src http://be.archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse
#Distribution updates
deb http://be.archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse
deb-src http://be.archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse
#Partner repository
deb http://archive.canonical.com/ lucid partner
deb-src http://archive.canonical.com/ lucid partner
- Ubuntu Backports
Provides backports (i.e. new versions of applications from newer distribution re-packaged for the current distribution) of specific applications (like Amarok) on request.
deb http://be.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse
deb-src http://be.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse
- ppa:kernel-ppa/ppa
Provides kernel backport candidates before making them available in the updates or security repositories.
The usual add-apt-repository does not work. Instead create file /etc/apt/sources.list.d/kernel-ppa.list:
deb http://ppa.launchpad.net/kernel-ppa/ppa/ubuntu lucid main
deb-src http://ppa.launchpad.net/kernel-ppa/ppa/ubuntu lucid main
gpg --keyserver keyserver.ubuntu.com --recv A8267963484B044F
gpg --export A8267963484B044F | sudo apt-key add -
- Old releases
Other repositories:
Install
Create an USB Startup disk
- Using Ubuntu Startup Disk Creator, one can create easily an USB startup disk (for any release, not just the same as the one used to create the startup disk)
Net boot install from Internet using GRUB
Reference: here
- Copy files initrd.gz and linux from one of the repository below to /boot
- Ubuntu 14.04 LTS Trusty Tahr amd64 or i386
- Ubuntu 12.04 LTS Precise Pangolin amd64 or i386
- Ubuntu 10.10 Maverick Meerkat amd64
- Ubuntu 10.04 LTS Lucid Lynx amd64 or i386
- Ubuntu 10.04 Karmic Koala amd64
- Ubuntu 9.04 Jaunty Jackalope amd64
- Restart, and type in GRUB command-line (press c in GRUB menu).
Note: change /boot/linux → linux and /boot/initrd.gz → initrd.gz if selected partition is mounted as /boot.
For Grub 2 (recent):
linux (hd0,msdos6)/boot/linux
initrd (hd0,msdos6)/boot/initrd.gz
boot
For Grub 2 (old):
root (hd0,6) # Select partition where /boot is. Type "root (hd0," and then TAB to get a list of partitions
linux /boot/linux
initrd /boot/initrd.gz
boot
For Grub 1:
root (hd0,6) # Select partition where /boot is. Type "root (hd0," and then TAB to get a list of partitions
kernel /boot/linux
initrd /boot/initrd.gz
boot
Net boot install from USB drive
This technique allows for very fast setup of a USB drive that can then be booted to start installation from network (Reference [1])
- Download the image boot.img.gz
- Ubuntu 10.10 Maverick Meerkat amd64
- Plug in the USB, and unmount it if necessary.
- The boot image is already pre-configured as a USB drive. Uncompress it to USB device (not partition!):
zcat boot.img.gz >/dev/sdb
Net boot from within Windows
This technique allows launching a network boot install without the need of CD or floppies. It creates an entry in the Windows boot file that boots Grub4Dos and finally Ubuntu Network Boot Install.
See InstallFromWindows for more information.
- Create a folder C:\boot
- Download linux and initrd.gz from http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-i386/current/images/netboot/ubuntu-installer/i386/, and save them in C:\boot
Next, for Windows XP:
- Download https://passechambre.appspot.com/get/grubfordos041pre22.tar.gz
- Extract grldr from the archive to C:\
- Create a new folder C:\boot\grub
- Extract menu.lst from the archive (found in folder /boot/grub) to C:\boot\grub
- Edit file c:\boot.ini, and append the line:
c:\grldr="Install Ubuntu"
- Edit the file c:\boot\grub\menu.lst, and append the lines:
title Install Ubuntu
kernel (hd0,0)/boot/linux vga=normal ramdisk_size=14972 root=/dev/rd/0 rw --
initrd (hd0,0)/boot/initrd.gz
- Reboot the PC, then first select Install Ubuntu from the windows boot menu, and finally Install Ubuntu from Grub menu.
- Troubleshoot
error 19 : cannot mount selected partition
- If you get the error above after selecting Install Ubuntu from Grub, this is probably because your Windows primary partition is not on (hd0,0) (a frequent cause for this is that the the first partition is used by the BIOS as an OEM rescue partition). To find which partition to use, go back in the Grub menu, then press c to go to the Grub command line. Then type:
kernel (hd0,TAB
- When pressing TAB, Grub will propose a list of possible partitions. Try to identify your windows primary partition from the list (usually the first ntfs partition). You can then either restart the PC, boot windows normally and edit the file menu.lst, or simply type the lines directly in the command line (e.g. assuming your windows partition is in (hd0,1)):
kernel (hd0,1)/boot/linux vga=normal ramdisk_size=14972 root=/dev/rd/0 rw --
initrd (hd0,1)/boot/initrd.gz
boot
Upgrade
- Start upgrade via update-manager:
sudo update-manager -d
- or via command-line
sudo do-release-upgrade
- After upgrade, list packages that are no longer coming from official sources:
apt-show-versions | grep -v uptodate
- For each of these packages, uninstall / purge if necessary, or fall-back to an official package. Avoid at all costs packages that are coming from no repositories (
No available version in archive
)
Guides
Ubuntu 14.04 Trusty Tahr
- http://itsfoss.com/things-to-do-after-installing-ubuntu-14-04/
- http://www.webupd8.org/2014/04/10-things-to-do-after-installing-ubuntu.html
- http://howtoubuntu.org/things-to-do-after-installing-ubuntu-14-04-trusty-tahr
- http://www.noobslab.com/2014/04/thingstweaks-to-do-after-install-of.html
- http://smashingweb.info/things-to-do-after-installing-ubuntu-14-04-lts-for-perfect-desktop/
Tips
Multi-task filtering by text input
- Press super-W to trigger compiz Scale plugin (windows spread)
- Type an application name to narrow the spread based on partial / complete word match [2]
Ubuntu on Laptops
My log on installing Ubuntu on various Laptops:
Dell Inspiron 2650 - Lucid 10.04.3
- Installation
- I had some issues to simply launch the Ubuntu installer.
- The laptop cannot boot from USB, and the CD i burnt with Lucid failed to start (maybe the CD was bad, or the reader lens was getting old).
- Finally I got it working with a network boot from withing windows (see #Net boot from within Windows above)
- During install, there was a freeze on some config screen. The screen was empty, however anything typed on the keyboard was echoed in the statusline. Finally pressing twice enter resumed the installation. Phew!
- Install ssh to guarantee remote access
- Always a good idea. However I had problem to simply get the text console. Ctrl-Alt-F1 did nothing at the login screen. I rebooted, then pressed Ctrl-Alt-F1 repeatedly, until login. This way, I could access the console:
sudo apt-get install ssh
- Issue with NVidia driver
- The laptop has an old Nvidia GeForce 2 card. Apparently this card is no longer supported in the newest version of nvidia driver (see [3]).
- The issue observed are garbage during the gdm login screen. The screen seems ok, but then the screen is not correctly refreshed.
- To fix that, I removed all nvidia drivers, and install the nvidia-96 one (i.e. the last one that still supports GeForce2 cards):
dpkg --get-selections nvi*
# nvidia-173-modaliases install
# nvidia-96-modaliases install
# nvidia-common install
# nvidia-current-modaliases install
sudo apt-get remove nvidia-current-modaliases
sudo apt-get remove nvidia-common
sudo apt-get remove nvidia-173-modaliases
sudo apt-get remove nvidia-96-modaliases
sudo apt-get install nvidia-96
- Reboot. Seems to work now!
- Issue with keyboard / touchpad not working
- The keyboard and touchpad does not work in login, but work in grub menu. This is really strange because I could swear they worked initially after installing Lucid.
- This is probably due to an update of the kernel or a package.
- Anyway, to fix this, simply add acpi=off at the kernel line at boot (after quiet nosplash) (see [4]). To make this setting permanent, edit /etc/default/grub followed by
sudo update-grub
.
HP Pavilion g6 (Marine's laptop)
Backlight off issue
When trying to boot Ubuntu Lucid Oneiric 11.10 from USB, the backlight remained off during boot and at login screen.
Solution:
- From [5]. The following solution seems to solve backlight issue at boot/login but also after power management. At boot screen, press shift when seeing the keyboard and human logo to go to grub menu. Press F6 and select option nomodeset.
- From [6]. At boot screen, press shift when seeing the keyboard and human logo to go to grub menu. Press F6 (or F7) and add the following options to boot line:
- Another solution, from [7], but it does not seem to work on that laptop:
sudo setpci -s 00:02.0 F4.B=00
quiet acpi_osi=Linux acpi_backlight=vendor splash
This works, but when power management turns off the screen, the backlight remains off.
Administration
Add a new Launchpad PPA repository
use add-apt-repository to add a new launchpad repository
sudo add-apt-repository ppa:kernel-ppa/ppa
Ubuntu Tweak
To install Ubuntu Tweak:
Since Ubuntu 11.04 Natty Narwhal, install v0.6 instead:
sudo add-apt-repository ppa:tualatrix/next
sudo apt-get update
sudo apt-get install ubuntu-tweak
Up to Ubuntu 10.10 Maverick Meerkat, install v0.5:
sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak
Network
- DNS in 12.04 (how to handle dnsmasq in Ubuntu Precise, Network-Manager DNS, etc)
Disable lightdm guest account
To disable guest account in lightdm, edit /etc/lightdm/lightdm.conf, and add:
allow-guest=false
Display Hidden Startup Applications in ubuntu 12.04 and Above
sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop
Assign Ctrl-Alt-Del to Shutdown dialog
Reference askubuntu
- Open keyboard app, and select shortcuts panel
- Change or disable current shortcut of System → Log out
- Click on + button and add the following custom shortcut:
- Name: Shutdown
- Command (until 13.04):
/usr/lib/indicator-session/gtk-logout-helper --shutdown
- Command (since 13.10):
/usr/bin/gnome-session-quit --power-off
- Shortcut: Ctrl-Alt-Delete
Kernel
- The Ubuntu Kernel Wiki (kernel archive)
- The Ubuntu kernel ppa (contain only very latest kernels)
Install new kernels
There are several sources for kernel on Ubuntu:
- The stable repository
- The security / updates repositories
Updates of kernel from stable, but also stable backports - The kernel PPA repository
Proposes backports before making them available in security / updates repositories. - The Ubuntu kernel archive at http://kernel.ubuntu.com/~kernel-ppa/mainline/.
To install a new version of the kernel:
- Choose manually the kernel version to install. You need to install the headers and the image, for instance:
sudo apt-get install linux-headers-2.6.32-28-generic-pae
sudo apt-get install linux-image-2.6.32-28-generic-pae
- Note that you might need to install one of the additional repository above if the version you request is not in your current set of repositories.
- Install one of the meta-packages (See linux-meta) linux-* and linux-headers-*. These always points to the latest kernel versions so that you will always receive all security/serious bug updates.
sudo apt-get install linux-headers-generic-pae linux-generic-pae # Generic PAE (for >=4GB systems)
sudo apt-get install linux-headers-generic linux-generic # Generic
sudo apt-get install linux-headers-virtual linux-virtual # For Virtual machine
sudo apt-get install linux-headers-server linux-server # For server
sudo apt-get install linux-headers-rt linux-rt # For RT kernel
sudo apt-get install linux-headers-generic-pae linux-generic-pae # Generic PAE (for >=4GB systems)
- Install one of the LTS backport kernels linux-image-*-lts-backport-* and linux-headers-*-lts-backport-*. These are kernel metapackages from new distribution releases that always point to the latest kernel in that release so that they are automatically updated when there is a serious kernel bug fix. For instance, on Lucid:
# Maverick backport
sudo apt-get install linux-headers-generic-pae-lts-backport-maverick linux-generic-pae-lts-backport-maverick
# Natty backport
sudo apt-get install linux-headers-generic-pae-lts-backport-natty linux-generic-pae-lts-backport-natty
These backports are available in security or updates repositories, or in the kernel PPA.
- We can see easily dependencies between linux packages with commands:
apt-rdepends -d linux-image-generic-pae | dot -Tpng | display
apt-rdepends -rd linux-image-generic-pae | dot -Tpng | display
- We can see that (at time of writing) that server kernels are actually synonyms for generic-pae kernels. We have indeed:
- Generic Linux kernel image: linux-imager-server points towards linux-image-generic-pae
- Generic complete Linux kernel : linux-server points towards linux-generic-pae
Remove old kernels
To remove old kernel entries in GRUB ([8] and [9], or other sol [10])
sudo apt-get remove --purge 2.6.28-11-* #to remove kernel 2.6.28-11
sudo apt-get purge 2.6.28-11-* #equivalent
An even easier solution is to install Ubuntu Tweak, and select Package Cleaner → Clean Kernels.
Devices
To see information on all connected input devices:
cat /proc/bus/input/devices
I: Bus=0003 Vendor=0c16 Product=0002 Version=0110 N: Name="Gyration Gyration RF Technology Receiver" P: Phys=usb-0000:00:06.1-1/input0 S: Sysfs=/devices/pci0000:00/0000:00:06.1/usb3/3-1/3-1:1.0/input/input7 U: Uniq= H: Handlers=kbd event7 B: EV=10001f B: KEY=837fff 2c3027 bf004444 0 0 1 c04 a27c000 267bfa d941dfed e09effdf 1cfffff ffffffff fffffffe B: REL=40 B: ABS=1 0 B: MSC=10
Medibuntu
Medibuntu is discontinued — Use libdvdcss from videolan instead (see medibuntu-fr)
- Add videolan repositories
wget -O - http://download.videolan.org/pub/debian/videolan-apt.asc | sudo apt-key add -
echo "deb http://download.videolan.org/pub/debian/stable /" | sudo tee /etc/apt/sources.list.d/libdvdcss.list
echo "deb-src http://download.videolan.org/pub/debian/stable/ /" | sudo tee -a /etc/apt/sources.list.d/libdvdcss.list
sudo apt-get update
- Old instructions to add medibuntu repositories
To install the Medibuntu repositories (see Community or here)
sudo wget http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get -q update
sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring
sudo apt-get -q update
Troubleshoot
When shutting down the PC with Samba (CIFS) shares mounted, the shutdown sequence hangs with the following error messages:
CIFS VFS: server not responding CIFS VFS: no response for cmd 50 mid xxx
This is apparently a bug that is creeping in Ubuntu since a long time ago. Basically there are 2 possible fixes (as in [11], [12], [13]):
The one I use, proposed by Daniel Ellis here [[14]]:
sudo mv /etc/rc0.d/S31umountnfs.sh /etc/rc0.d/K31umountnfs.sh
sudo mv /etc/rc0.d/S40umountfs /etc/rc0.d/K40umountfs
sudo mv /etc/rc6.d/S31umountnfs.sh /etc/rc6.d/K31umountnfs.sh
sudo mv /etc/rc6.d/S40umountfs /etc/rc6.d/K40umountfs
Another one (not tried yet):
sudo ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
sudo ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh
Troubleshooting 'System program problem detected'
- We may get this message while logging in. This message indicates that a system program crashed, but unfortunately there are no other details.
- We look at var/crash/ to get more information. There we see a file named _usr_sbin_aptd.1000.crash.
- Opening the file we see
...
ExecutablePath: /usr/sbin/aptd
...
ProcCmdline: /usr/bin/python /usr/sbin/aptd
...
DBusException: org.freedesktop.DBus.Error.AccessDenied: Connection ":1.90" is not allowed to own the
service "org.debian.apt" due to security policies in the configuration file
- So basically the program aptd cannot run because user do not have the right permission. aptd is used to allow package management from user space.
- The policy file is /etc/dbus-1/system.d/org.debian.apt.conf. File format is given by dbus-daemon manual page. We can fix the policy issue as follows:
--- a/dbus-1/system.d/org.debian.apt.conf
+++ b/dbus-1/system.d/org.debian.apt.conf
@@ -7,9 +7,5 @@
<policy user="root">
<allow own="org.debian.apt"/>
</policy>
- <policy group="sudo">
- <allow own="org.debian.apt"/>
- </policy>
-
<policy context="default">
<allow send_interface="org.debian.apt"/>
<allow send_interface="org.debian.apt.transaction"/>
--- a/dbus-1/system.d/org.freedesktop.PackageKit-aptd.conf
+++ b/dbus-1/system.d/org.freedesktop.PackageKit-aptd.conf
@@ -13,9 +13,5 @@
<policy user="root">
<allow own="org.freedesktop.PackageKit"/>
</policy>
- <policy group="sudo">
- <allow own="org.freedesktop.PackageKit"/>
- </policy>
-
<!-- Allow anyone to call into the service - we'll reject callers using PolicyKit -->
<policy context="default">
- However that fix might open a security vulnerability. Checking the history of the file org.debian.apt.conf, we see that there was no change in that file since last install, and so the fix above is most probably not the correct one.