Ubuntu installation: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
 
(226 intermediate revisions by 2 users not shown)
Line 4: Line 4:
[http://www.ubuntu.com/ Ubuntu] is a popular [[Linux]] distribution, best suited for desktop computers. It is based on Debian, therefore the packaging (*.deb) works rather well.
[http://www.ubuntu.com/ Ubuntu] is a popular [[Linux]] distribution, best suited for desktop computers. It is based on Debian, therefore the packaging (*.deb) works rather well.


This page so far is by no means a configuration and installation guide, but it contains some extra information. [[User:Daniel K. Schneider|Daniel K. Schneider]] decided to put some of his installation notes in this wiki, so he won't loose them. Feel encouraged to add stuff :)
'''Disclaimers'''
* This page so far is by no means a configuration and installation guide, but it contains some information that could be of use to some people. [[User:Daniel K. Schneider|Daniel K. Schneider]] decided to put some of his installation notes in this wiki, so he won't loose them.  
* I am be no means a systems expert. As you can see from other entries in this wiki I deal with lots of stuff and lots of it I don't really master ...
* Feel encouraged to add stuff :)
 
=== Identify your machine and system ===
 
Find out what distribution you already have:
more /etc/issue
uname -a
 
Find the serial number for your machine (e.g. a Dell service tag)
sudo dmidecode -s system-serial-number
: However, this may not work. E.g. on my new Dell Precision tower, this fails (as of June 2017)


== Installation documentation ==
== Installation documentation ==


The best short guide I found (including Nvidia):
Start with the official Ubuntu site (sometimes a bit lengthy):
* [http://www.funnestra.org/ubuntu/hardy/ Ubuntu 8.04 (Hardy Heron) How-To]
* [https://help.ubuntu.com/community/Installation official installation guides]


If you are looking for an other '''practical, short and excellent''' installation guide (and that includes how to add non-free software):
Sometimes it is useful to hunt down short installation documentation on other sites than Ubuntu.
If you are looking for an other '''practical, short and excellent''' installation guides (and that may include how to add non-free software):
* [http://www.futuredesktop.org/ future desktop]
* [http://www.futuredesktop.org/ future desktop]
* [http://ubuntuguide.org/wiki/Ubuntu_Precise UbuntuGuide.org] (last LTS version)
* [http://ubuntuguide.org/wiki/Main_Page Ubuntuguide.org] (guides for most recent version)
After installing (Thanx a lot to you guys, the articles below really did help me to get a somewhat decent working environment - [[User:Daniel K. Schneider|Daniel K. Schneider]] 22:06, 20 September 2012 (CEST))
* [http://www.unixmen.com/201204-top-things-to-do-after-installing-ubuntu-2/ Top things to do after installing Ubuntu 12.04 and 12.10 Quantal Quetzal]
* [http://www.noobslab.com/2012/04/important-things-to-do-after-install_26.html Important Tweaks/Things to do After install of Ubuntu 12.04 Precise Pangolin]
* [http://debianhelp.wordpress.com/2012/03/09/to-do-list-after-installing-ubuntu-12-04-lts-aka-precise-pangolin/ To Do List After installing Ubuntu 12.04.1 LTS aka Precise Pangolin]
== Upgrading Ubuntu 18.04 to 20.04x to 22.04 LTS ==
Firstly upgrade to the latest 18.04
sudo apt update
sudo apt upgrade
Then do it
sudo do-release-upgrade
I did the 20.04 LTS upgrade on June 3 2021 and it worked without any extra work, including my double screen configuration. Maybe because I got an older PC, but I am still happy :) The whole procedure took about 90 minutes where I had to answer a few questions, using the default answer.
lsb_release -a
LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
In 2023 I upgraded from 20.04 to LTS 22.04 without problems.
LSB Version: security-11.1.0ubuntu4-noarch
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
== Upgrading Ubuntu 16.04 to 18.04 LTS ==
For major update, I '''strongly''' suggest waiting until the official update path is cleared, i.e. wait until <code>sudo do-release-update</code> works. I once forced the install and it miserably failed. So I had to install a new system and that went well (I only to change my uid/gid and mount server partitions again and, of course, reinstall all the software, but that was extra work ....)
Firstly upgrade to the latest 16.04
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
Early adopters:
sudo do-release-upgrade -d
else
sudo do-release-upgrade
=== Upgrading a desktop ===


The Ubuntu site also has a lot of useful information (though sometimes a bit lengthy):
I tried before the official upgrade and it broke the system (the same as described for version 16.x below)
* [https://help.ubuntu.com/community/Installation official installation guides]


This wiki also has some interesting information
The process broke in the middle since some dependencies were not met.... For now I don't know if this can be fixed.
* [http://ubuntuguide.org/wiki/Ubuntu:Hardy Ubuntuguide.org]
<source lang="bash">
sudo apt install -f
Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... failed.
The following packages have unmet dependencies:
glib-networking : Depends: libglib2.0-0 (>= 2.55.0) but 2.48.2-0ubuntu1 is installed
glib-networking-services : Depends: libglib2.0-0 (>= 2.55.0) but 2.48.2-0ubuntu1 is installed
gnupg : Depends: gnupg-l10n (= 2.2.4-1ubuntu1.1) but it is not installed
        Depends: gnupg-utils (= 2.2.4-1ubuntu1.1)
        Depends: gpg (= 2.2.4-1ubuntu1.1)
        Depends: gpg-wks-client (= 2.2.4-1ubuntu1.1)
        Depends: gpg-wks-server (= 2.2.4-1ubuntu1.1)
        Depends: gpgsm (= 2.2.4-1ubuntu1.1)
        Depends: gpgv (= 2.2.4-1ubuntu1.1)
        Breaks: python3-apt (<= 1.1.0~beta4) but 1.1.0~beta1ubuntu0.16.04.1 is installed
        Breaks: software-properties-common (<= 0.96.24.3) but 0.96.20.7 is installed
libc6-dbg : Depends: libc6 (= 2.23-0ubuntu10) but 2.27-3ubuntu1 is installed
libc6-i386 : Depends: libc6 (= 2.23-0ubuntu10) but 2.27-3ubuntu1 is installed
libgail-3-0 : Depends: libglib2.0-0 (>= 2.49.4) but 2.48.2-0ubuntu1 is installed
libglib2.0-bin : Depends: libglib2.0-0 (= 2.56.1-2ubuntu1) but 2.48.2-0ubuntu1 is installed
libgoa-1.0-0b : Depends: libglib2.0-0 (>= 2.52) but 2.48.2-0ubuntu1 is installed
libgoa-backend-1.0-1 : Depends: libglib2.0-0 (>= 2.52) but 2.48.2-0ubuntu1 is installed
libgtk-3-0 : Depends: libglib2.0-0 (>= 2.55.2) but 2.48.2-0ubuntu1 is installed
python-apt : Depends: libapt-inst2.0 (>= 1.4~beta3) but 1.2.26 is installed
              Depends: libapt-pkg5.0 (>= 1.4~beta3) but 1.2.26 is installed
python3 : PreDepends: python3-minimal (= 3.5.1-3) but 3.6.5-3 is installed
          Depends: libpython3-stdlib (= 3.5.1-3) but 3.6.5-3 is installed
python3-minimal : Depends: python3.6-minimal (>= 3.6.5-2~) but it is not installed
python3.6 : Depends: python3.6-minimal (= 3.6.5-3) but it is not installed
</source>


== Ubuntu 10 8.04 LTS installation start in a nutshell ==
Probably I first should try removing packages installed from a PPA, e.g. Inkscape.


=== Step 1: get it ===
https://askubuntu.com/questions/307/how-can-ppas-be-removed
Download site
* http://www.ubuntu.com/getubuntu/download


Decide what version you want. Basically there are 4 options for a desktop machine: 32 vs. 64 bit machines and normal vs. alternative distribution.
Anyhow, I just killed the machine and installed a new 18 version. Reinstalling can be justified if you need several new software, e.g. Inkscape and do not want to upgrade these via an external PPA. Before you do so, backup your home and maybe some other configuration files.


* 32 bit (most machines, also some third-party software may only run 32bits). Two subchoices:
== Upgrading Ubuntu 14.04 to 16.04 LTS ==
** ubuntu-8.04.1-desktop-i386.iso  (this is your "normal" choice)
** ubuntu-8.04.1-alternate-i386.iso


* 64 bit (more expensive desktop machines)
This upgrade was available since July 21 2016 (16.04.1 LTS)
** ubuntu-8.04.1-desktop-amd64.iso (also includes Xeon etc. processors)
** ubuntu-8.04.1-alternate-amd64.iso


Finally, there exist also vendor-packaged images that include additional goodies, e.g. graphics card drivers. E.g.
Upgrade to latest 14.04 (not sure that this is really needed)
* DELL: [http://linux.dell.com/files/ubuntu/hardy/iso-images/ ubuntu-8.04.1-dell-reinstall.iso]
sudo apt-get update
* Edubuntu: [http://edubuntu.org/Download Download Edubuntu]
sudo apt-get dist-upgrade
sudo apt-get autoremove


The image you will download is an ISO ready to burn CD image (so you need a program to do this). Read [https://wiki.ubuntu.com/BurningIsoHowto/ burn the image].
Upgrade to 16.04 LTS
sudo do-release-upgrade


; Memory errors and stupideness
If this doesn't work, try


I spent about a weekend burning various CD's (32bit normal, alternate, 64bit) because I thought first that downloaded ISO images were damaged during burning and then that my hardware couldn't handle it. Got SQUASHFS and other decompression errors.
sudo update-manager -d


That was a weekend lost. I simply had to replace the RAM. It was slightly defective (after all, the days before I did use my system, though I had some Firefox and Thunderbird crashes. Never occured to me to test the RAM. Bad RAM if intensively used such as in the install process will make it fail. PERIOD.
=== Upgrading a DELL Precision tower ===


So if you insert a CD for testing and returns errors, do it again. If the file is not the same, then blame your RAM. Basically you can ignore the "burning horrors" below, unless you really have problem with downloading or burning. Just make sure to burn at relatively low speed....
Even in April 2017, a high end DELL desktop workstation comes with Ubuntu 14LTS (pre-installed). I got a 5810 tower with a Xeon E5-1620 v3 (Four Core HT, 10MB Cache, 3.5GHz Turbo, a 500GB SSD and a NVIDIA® Quadro® M4000 8Go graphics card. That system does not want to upgrade, or at least mine would not.
* [https://certification.ubuntu.com/hardware/201405-15064/ Ubuntu certification] is 14.04 LTS 64-bit


; Burning horrors
Symptoms:
* Doing the steps above broke the GUI (Can't log in anymore). This is not related to upgrading to 16LTS but still a big hassle (see below)
* From a terminal (hit CTL-ALT-F1), the do-release-upgrade command won't find any upgrades. It says:
No new release found


It is likely that you might download a bad image (see step 3). Make sure that your image is correct with [https://help.ubuntu.com/community/HowToMD5SUM How to MD5SUM]. E.g. if you download to a Unix machine, type something like:
Someone (at DELL) decided that you should not update, so <code>iff</code> you believe that you should upgrade, then change this setting even before any upgrading / updating to newer 14LTS packages.
md5sum ubuntu-8.04.1-desktop-i386.iso
* Edit <code>/etc/update-manager/release-upgrades</code> and set Prompt=lts


This file name may change of course. The output should be a single line which you can match again the magic number, e.g.
If your system is new (like mine), you could use the Nano editor, e.g. type:
  c69e34e92d5402d1b87e6babc739f774
sudo nano /etc/update-manager/release-upgrades
for the ubuntu-8.04.1-desktop-i386.iso image. These is an official [https://help.ubuntu.com/community/UbuntuHashes list] (if you don't trust your mirror).


Anyhow, if Ubuntu is happy (see also step 3) you don't need to worry about this.
Now
sudo do-release-upgrade


Also to download, you may avoid using a browser, there exist FTP mirrors. Alternatively you can use a program like wget if you do this from a unix machine. Copy the download link from the appropriate mirror and type e.g.
This went pretty well, except that the the GUI was still broken. Nvidia drivers are proprietary and even if you install new ones from the graphics repository (see below), I could not login.
  wget --no-cache http://releases.ubuntu.com/hardy/ubuntu-8.04.1-desktop-i386.iso
or (better) from a trusted mirror:
  wget --no-cache http://mirror.switch.ch/ftp/mirror/ubuntu-cdimage/hardy/ubuntu-8.04.1-desktop-i386.iso


Now burning is another '''painful''' issue (see step three). I took the simple default CD version from some ubuntu mirror and first used [http://infrarecorder.sourceforge.net/ infra recorder] on a Windows machine to burn the image (Menu Actions -> Burn Image..). Despite setting it to low burn speed it didn't work (i.e. failed the test in the Ubuntu installation). So I took another laptop and burned with Roxio. After 3 attempts (enabling all options like checking, very long file names, etc. it did seem to work at first (test passed). But during the install (some SQUASHFS error) and with a second test it failed again. So you actually may have two problems: CD is bad or the installation program (i.e. the SQUASHFS program) has a problem
To fix that:
* Disable secure boot (sorry I was too fed up to take notes, but), the most important part is;
* run a terminal: CTL-ALT-F1, then type:
sudo update-secureboot-policy
* Then enter a password you can remember, e.g. yours, and then immediately reboot. It will then ask you to enter the password you just gave in a weird way, character by character.


Frustrating as experience. In '''any case''' set burning speed to something that is '''really low" (like 4 or 8), but never maxium !
Now I could log into the system, but the there was no desktop (i.e. compiz was broken). There was only the graphics layer. With that you can still open open a terminal (right click) but it cannot be moved since compiz did not work. In order to get the control center, you could type in terminal:
unity-control-center --overview
... but there is nothing in there that would fixing the problem. However, you can create a new user (see below)


If your CD seems to be ok and installation fails you '''first''' should check your RAM. Only then go for another install (e.g. download the [http://linux.dell.com/files/ubuntu/hardy/iso-images/ fat DVD] total ubuntu-only reinstall DVD ISO from DELL or the alternative CD from Ubuntu.
Solution: Kill yourself and get a new better self. Do do so:
* Create a new user with root privileges, e.g. call it admin (and so make sure that he/she got these privileges !!)
* Kill your user
* Create a new one. Also consider getting good uid and gid values, e.g. the same that you would have on other machines in your network.


* Finally, make sure to have an Internet number ready if you use your machine at work.
Comment:
* This is not the first time I have trouble installing or upgrading a Linux desktop. Windows is so much easier. However once Ubuntu is up and running I feel more comfortable with it.
* On the positive side, this DELL machine does seem to be fast, e.g. will load 3.5 Mio Meshes into Meshlab really fast. It even can play games through Steam. It also is very silent.


=== Step 2: save some stuff in your old ubuntu install ===
== Ubuntu upgrades ==
(if you have one, else skip).


If you mount foreign file systems
=== Which version do I run ===
* /etc/fstab
If you have a special video setup
* /etc/X11/xorg.conf
....


If you don't have your home on a different partition make a gtar archive
Type:
tar zcf archiveXX.tgs directory
lsb_release -a
* save all homes (I don't keep any real data on my personal machine, but you may later retrieve some config files or navigator bookmarks.)
* You also may save /usr/local (but it's better to reinstall !)


=== Step 3: Format or repartition if you plan to continue using windows ===
=== Minor upgrades ===


* I don't want windows on this machine (erased it sometimes)
From the command line, to update the repository information:
* You also may consider reformatting the hard disk (you can do this during the install process)


* If do want Windows, you may consider sharing a partition and this is a bit tricky (see docs elsewhere).
sudo apt-get update


=== Step 4: Boot the PC with the CD and enter installation ===
'''To upgrade'''


* You may have to hit F12 or F2 (watch!) when the machine wakes up, select the CD-Rom Drive
sudo apt-get dist-upgrade
* You then must select a language (English for example)
: will do the upgrade fairly smartly (make sure that all dependencies work)
* You also should define your location and keyboard. Hit the F2 and F3 buttons at the bottom of the screen.
sudo apt-get dist-upgrade
* You also should check the integrity of the CD. '''Bad files can be a total showstopper''' ! I suspect that errors can have two reasons: A bad CD (sometimes), damaged RAM, or some hardware incompatibility (bad trouble for you).
: will upgrade the existing packages to the latest version
* Do '''not''' "try" Ubuntu without change unless you are afraid that Ubuntu is not compatible with your hardware. If your decision is made click on '''"Install Ubuntu"'''


... then wait a bit ... if nothing happens, it can mean that your RAM is damaged, your CD is bad or
=== Hash Sum mismatch issues ===
that your PC can not handle it.


=== Step 5: Try other versions if needed ===
If something like ''GPG error: http://mirror.switch.ch hardy-updates Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>'' happens, you might change the server. Either,
* Edit  ''/etc/apt/sources.list''
Or
* change with menu System->Administration->Software sources


Give up on the desktop version, if the installation fails after 2 half days or so. Take the
Or get a new key
alternative version. The interface is uglier, has less functionality, but it let's
(2) Identify the missing ones
you repartition and format at early stage and make some more technical choices.
sudo apt-get update
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com XXXXXXXXXX
: XXXXXXXXX is the missing key.


The problem is that you then have to install things more manually which is not really difficult but requires some reading...
=== Major upgrades ===


=== Step 6: Make life a bit easier ===
* You can upgrade from LTS to LTS (however that takes a little bit of waiting, e.g. 12.04 LTS will upgrade to 14.04.01
* Upgrade '''first''' the existing installation
* Clean repository information. I.e. remove those that don't work anymore (read [http://askubuntu.com/questions/307/how-can-ppas-be-removed this] (command-line) or [https://help.ubuntu.com/community/Repositories/Ubuntu that] (details, search for "removing").
apt-get dist-upgrade


In Ubuntu a desktop user can't seem to log in as root. It never asked me for a password during install. I must be root, since entering "sudo" plus a password for every command drives me crazy. The trick is simple:
'''To upgrade'''
do-release-upgrade -d


sudo su
=== PHP/MySQL trouble with a 10.04 to 12.04 upgrade ===


Then type:
* Read [http://askubuntu.com/questions/125686/mysql-fails-to-start-after-upgrade-installation-etc this] and similar. It helped. I had to force remove remove everything mysql before I could install a 5.5 version + all the other things that were remove (like php-mysql).
passwd
... now you have root password :)


== Installing a desktop from the alternate no-desktop distribution ==
* PHP can't find some extensions. Install these again, e.g.
apt-get install php5-gd php5-mcrypt php5-suhosin


So I finally got ubuntu-8.04.1-alternate-amd64.iso and wind up in a root terminal after boot.
== Networking, file systems and users ==


Some stuff is alread on the CD. First thing you want is the X11 system and a desktop. Reinsert the same CD and type the following. However I suggest taking this rather from an Ubuntu mirror (see packages)
=== Defining a fixed IP number ===


  apt-get install ubuntu-desktop
By default, a workstation will use numbers from DHCP and that should work without problems.
  /etc/init.d/gdm start
Then
  startx


Then you can use the GUI to define you as user and configure the network.
Alternatively, you also can, in some institutions, that DHCP always provides you with a fixed address. '''Ask'''. This solution works in our institution.


Next thing is to select repositories. The easiest way is to use the "synaptic package manager" that can be found in the System->Administration menu. The click on "Settings->Repositories" and select either the fastest or one you trust. In the same software sources panel, you also may tick most checkboxes. Alternatively, edit the configuration file in /etc/apt.
Finally, if you want to add manually a or several fixed IP numbers.
* Get one from your computer services
* Read [https://help.ubuntu.com/lts/serverguide/network-configuration.html Network Configuration]


Then you have to upgrade. That also was quite a nightmare, since apparently my (now that new) hardware was not fully compatible....
More simply, on a workstation, use the "Network" tool in the <code>System settings</code>. Click on Options, then the various tabs ...


One thing that seems to be needed '''if''' you have the server version is:
=== Mounting external NFS partitions ===
apt-get install linux-restricted-modules-server


== NFS ==
Read more about this topic:
* [https://help.ubuntu.com/community/SettingUpNFSHowTo Setting Up NFS How To] (Ubuntu Community Help Wiki)
* [https://help.ubuntu.com/community/Fstab Introduction to Fstab] (Ubuntu Community Help Wiki)


; Installing mnt and mount points
; Installing mnt and mount points
It's a bad idea to keep your files on your personal PC. Since we have sun servers with daily backup I just mount partitions via NFS. This may not be included.
It's a bad idea to keep your files on your personal PC. Since we have sun servers with daily backup I just mount partitions via NFS. NFS may not be included in your install


  apt-get install nfs-common
  apt-get install nfs-common
Line 159: Line 262:
  mount -a
  mount -a


; Changing your user id
'''Changing your user id to make it compatible with the one that sits on the server'''
 
* If you installed from the standard distribution, your user is is not compatible with the one you have on an other machine, so you have to change it. You can use the user management tool in the System menu (click on "unlock").
* If you installed from the standard distribution, your user is is not compatible with the one you have on an other machine, so you have to change it. You can use the user management tool in the System menu (click on "unlock").
* Create a new group first and use the gid from your server (type ''id- a'' on the server machine)
* Create a new group first and use the gid from your server (type ''id- a'' on the server machine), e.g. to create a group "stars" with gid 6001:
* To change your user id is more tricky, can't do this while you are in the desktop. An easy method is to use the ''usermod'' tool (after logging out from the GUI !!), e.g.to change user dks to uid=6000
groupadd -g 6001 stars
* To change your user id is more tricky, can't do this while you are in the desktop. An easy method is to use the ''usermod'' tool (after logging out from the GUI and login in with another user !!), e.g.to change user dks to uid=6000
  usermod -u 6001 dks
  usermod -u 6001 dks
or if you want to change the uid too:
or if you want to change the uid too:
  usermod -g 6000 -u 6001 dks
  usermod -g 6000 -u 6001 dks
'''Firewall'''
If the ''mount -a'' doesn't work there could be a firewall problem. You will have to open NFS communication channels. On the '''server machine''', check the 2049 port.
grep nfs /etc/services
... might tell you what ports nfs needs, e.g.
nfs 2049/tcp # Network File System
nfs 2049/udp # Network File System
Now check if these ports are open
sudo ufw status
Change if necessary on the server machine (see below for more details)
ufw allow from your_client_ip to any port 2049 proto udp
ufw allow from your_client_ip to any port 2049 proto tcp
sudo ufw reload
: replace your_client_ip by the ip (or domain) of your client machine
=== Exporting partitions with NFS ===
Become root, or add "sudo" in front of all commands ...
Either NFS or Samba allow to share a partition with other (client) machines. In order to use NFS:
1) Install NFS on your server machine
apt-get install nfs-kernel-server
2) Configure the directories to be exported by adding them to the /etc/exports file. For example:
/export/data mymachine.yourorg.org(rw,sync,no_subtree_check)
will export the directory /export/data/ for the host (computer) mymachine.yourorg.org with (with-permissions). Do not use something like:
/export/data *(rw,sync,no_root_squash)
I.e. only give specific machines access to your partition and do not let your client machine be root.
2b) If your client machine (e.g. a personal Linux computer) is not in the DNS, then you can either provide an Internet number or define your machine in the /etc/hosts file, e.g.
129.xx.y.z  mymachine
Then in the /etc/exports use something like
  /data mymachine(rw,sync,no_subtree_check)
or
  /data mymachine(rw,sync,no_subtree_check) mylaptop(rw,sync,no_subtree_check)
or
  /web 192.0.2.1(rw,sync,no_subtree_check)
After doing so, type in the shell
exportfs -a
And check:
exportfs
3) Mount the exported directory on your client machines, as already explained above. Firstly make sure that nfs-common is installed.
apt-get install nfs-common
* Create an empty directory, e.g.
mkdir /mnt/data
* Edit file /etc/fstab on your client machine
  servermachine.x.y:/export/data /mnt/data nfs defaults 0 0
* Then type on your client machine:
  mount -a (on your machine)
If it doesn't work, look at the log files of the server machine. Most likely you failed to give permission. Also, you should restart the NFS daemon on the server. Type:
/etc/init.d/nfs-kernel-server restart
4) User id and group ids
If you want to write files in the server, then user and group id's must match on both machines....
=== Creating groups ===
To create an ordinary group of users:
groupadd -g GID_number group_name
e.g.
sudo groupadd  -g 1200 toto
=== Creating users ===
* On your desktop machine, you can use the system menus
** Unlock (top right) in the user accounts tool, then click on the +.
* On a server, you can use ''useradd''. Make sure that user and group id's match those of other machines in case you plan to mount partitions (e.g. a web server directory on your desktop).
;useradd -ggroup_name -uNNNNN -m -p XXXXX login_name
: group_name = name of primary group
: NNNNN = uid number, e.g. 160001
: XXXXX = password
: login_name = login + home directory name, e.g. ''dks''
If you want to add the user to other groups, use the -G flag or use ''usermod''.
E.g.
: usermod -Gadmin,adm dks
: will add the user ''dks'' to the adm and the admin group.
A simpler way to make someone admin, is to use the GUI (User Accounts tool in the System tools)
;id -a [''login'']
: will display an id of a user
=== Using Samba ===
* [http://praxis.edoceo.com/howto/samba4 http://praxis.edoceo.com/howto/samba4]
* [http://wiki.samba.org/index.php/Samba4 Samba4] (Samba wiki). RC as of nov 2012
List verbously all users
* sudo pdbedit -L -v
Add a user (Samba V3)
* sudo smbpasswd -a sambausername
* Depending on your setup you also may have to give permission to use shares. Otherwise, we suggest using a kind of group permission in your /etc/samba/smb.conf file, e.g.
[data]
              path = /pics
              comment = Data
              writeable = yes
              valid users = @tourists
              create mask = 0664
              directory mask = 0775
=== SFTP demon ===
sudo apt-get install openssh-server
Read: [https://help.ubuntu.com/lts/serverguide/openssh-server.html OpenSSH server]
=== Copying files from the old machine ===
'''Via scp'''
An easy way to copy files is to use the scp command which is installed by default.
: Exemple - copy recursively a directory from old remote host to the current directory in new (local) machine. On your new, local machine, type something like:
cd ~/some
scp -r username@remote.host:/home/user/some/source_dir/ .
'''Via rsync'''
The rsync program allows to synchronize files between two machines and also can be used to copy and can be recommended to distracted people...
'''Make sure to include either a trailing slash''' in the destination folder or go there ! <code>dry-run</code> does what it implies and you should use it first.
: Copy to remote (dry run)
sudo rsync --dry-run -azvv -e ssh /home/path/folder2/ remoteuser@remotehost.remotedomain:/home/path/folder2
: Get a directory from remote
cd target
rsync -avzh user@remote.host:/home/user/source_dir .
: Synchronise Music from remote without displaying (wait for a few minutes or hours)
cd
rsync -azh schneide@129.194.30.22:/home/schneide/Music .
'''Via Tar and ssh'''
* Using tar archives is probably the fastest way, e.g. from the old machine do something like:
(cd /home/path && tar czf - . ) | ssh user@new.machine 'cd /home/path && tar xzf -'
== Keyboards ==
Can misbehave.
In case you got sticky keys: Press the accessibility icon on top menu bar and disable sticky keys. Same for slow keys. (See [https://help.ubuntu.com/stable/ubuntu-help/a11y-slowkeys.html.en this])
If key mappings are wrong and you got a logitech keyboard, see below.
=== For Logitech Devices ===
Did not work for me. Even the latest 1.18 version did not recognize the Logitech K280e on Ubuntu 22.04 LTS. This wasn't a real problem, since this keyboard works really well.
sudo apt install solaar
solaar
Hower, solaar may not be up-to-date in the official repository and your Logitech device may not be dectected. In that case, you can try downloading a newer version from the repository. For example
sudo add-apt-repository ppa:solaar-unifying/stable
sudo update
sudo apt upgrade solaar


== Displays ==
== Displays ==


Most Linux distribution's installer (at least the free ones) can't handle some slightly more fancy hardware automatically
=== Principles ===
 
Ubuntu 18 easily detects two high resolution monitors (probably under the condition that you did install the third party modules, i.e. an option when you install the system)
 
Most older Linux distribution's installers (at least the free ones) can't handle some slightly more fancy hardware automatically. Usually you have to do either of two things
# Configure the drivers from the ubuntu desktop (if your are lucky) and then use ''nvidia-settings''
# Hand edit the /etc/X11/xorg.conf file to tweak things.
 
Also read:
* [http://www.ubuntugeek.com/how-to-install-nvidia-295-40-drivers-in-ubuntu-12-0411-10-using-ppa.html How to install Nvidia 295.40 drivers in ubuntu 12.04/11.10 using PPA]
* [http://www.trevorfitzgerald.com/2007/03/ubuntu-twinview-monitors-with-an-nvidia-graphics-card/ Ubuntu Twinview Monitors with an NVidia Graphics Card] (T. Fitzgerald/3/2007)
 
* Remember to save every version (preferably on an other machine or in a wiki) that worked.
 
=== High resolution monitors for Ubuntu 16.x and sound ===
 
I got
* a DELL Precision T5810 with a Xeon E5-1620
* a Quadro M4000 graphics card with two monitors
* a DELL UP3216Q 32'' (3840 X 2160) at 60Hz
* a DELL U2715H 27'' (1440 X 2560), i.e. rotated vertically, at 59.95 Hz
The card has four DisplayPort (DP) slots and the (combined) X Screen 0 has 5280x2560 pixels (1397x677 millimeters)
 
Connecting a high resolution (as of 2017, i.e. 4K) and a half-high resolution monitor does work for both Ubuntu 16 LTS and 18 LTS.
 
Main trouble when connecting the monitor was that I did not push in the DP connector enough on display side and the system would not detect the monitor. Only after switching the cable I figured it out. Also when you close the "door" at the back of the screen, the DP can become loose again...
 
Using DP seems to affect sound output, i.e. after connecting a DP monitor sound will be gone ...
 
* Either install <code>pavucontrol</code> and use Line Out built-in Audio (the normal Sound controls will not detect this)
* Or connect the loudspeakers directly to the monitor. In that case they will be detected as HDMI/Display Output in both. The normal "Sound" settings also will see the speaker now (HDMI/DisplayPort/GM204 High Definition Audio Controller). That is the solution I adopted.
 
=== Installation of Nvidia Drivers ===
 
This is not required usually. Only do it iff you run into trouble.
 
Some documentation
* [https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia  BinaryDriverHowto/Nvidia]
 
Firstly, you should know what drivers you have got. In a terminal, type:
  nvidia-smi
The should you see something like the following, i.e. driver version and card model.
Fri Apr 28 18:02:59 2017     
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 381.09                Driver Version: 381.09                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|        Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|  0  Quadro M4000        Off  | 0000:03:00.0      On |                  N/A |
| 46%  38C    P8    13W / 120W |    179MiB /  8111MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
Alternatively, try
nvidia-settings
 
If you don't see anything, then there is no driver installed (or you may not have an Nvidia card).
 
To install or replace a drive, make sure that your machine allows installiong 3rd party drivers.
 
If you cannot see or use the desktop:
CTRL-ALT F1: To get a terminal
 
Get rid of old nvidia drivers
sudo apt-get purge nvidia-*
 
Install the repository (if not already done so)
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update.
 
Figure out the name of the latest driver. There are several strategies:
* Google
  sudo ubuntu-drivers devices
 
Install the latest driver
# sudo apt-get install nvidia-370 // Make sure to take the best driver you need. Best can be the latest, but not necessarily so...
sudo apt install nvidia-381
 
=== Adjust to high resolution screen in Ubuntu 16 ===
 
Setting default fonts of all application is difficult in Ubuntu. You may have to change several settings using several tools. After an upgrade, settings may revert (so keep a note of what you did). Read more [https://askubuntu.com/questions/472262/adapt-ubuntu-to-a-high-dpi-resolution-screen here] (Adapt Ubuntu to a high-DPI resolution screen)
 
In Ubuntu 16, you easily can tune the size of menu bars. In the system settings go "Displays" and set the "Scale for menu and title bars", e.g. to 1.38 for a 3840x2160 32'' screen and 1.2 for a 2560x1140 27''
unity-control-center display
 
Fixing menu bars will not fix application fonts. You could change "universal access" fonts, but the applications that do respect this (e.g. terminal, thunderbird, ryhthmbox already do adjust font pixels. If you want to try nevertheless, type:
  unity-control-center universal-access
: Seeing --> Large Text; Slide to On
 
Firefox:
about:config
: set <code>layout.css.devPixelsPerPx</code> to a value between 1.2 and 1.5 (I use 1.3 but I got good glasses)
 
Thunderbird:
* Fonts are fine on the main screen but too big on the small 27'' monitor that has a lower resolution
* Best solution: Install [https://addons.mozilla.org/en-US/thunderbird/addon/theme-font-size-changer/ font-size-changer plugin]
 
Java:
* Older Java applications are definitely the worst UI experience you can get. Not only you will have to cope with strange panel controls but also you won't be able to read anything. You can try [https://askubuntu.com/questions/526484/fix-scaling-of-java-based-applications-for-a-high-dpi-screen Fix scaling of java-based applications for a high DPI screen] who propose a python or a bash script to change resolution.


Usually you have to do two things
=== Adjust to high resolution screen in Ubuntu 18 ===
# Find and install a driver for your graphics card
# Hand edit the /etc/X11/xorg.conf file.


* Also read [http://www.trevorfitzgerald.com/2007/03/ubuntu-twinview-monitors-with-an-nvidia-graphics-card/ Ubuntu Twinview Monitors with an NVidia Graphics Card] (T. Fitzgerald/3/2007)
Install unity tweak tools.


=== Example Nvidia FX + 2 digital monitors ===
Upgrade the system first !
By [[User:Daniel K. Schneider|Daniel K. Schneider]]. I have a Quadro FX 3450 card, a 24'' and a 20'' monitors.
This is an executive summary. Find better explanation on Google or in the  
* [https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia the Ubuntu documentation]


; The easy way (Ubuntu 8.01 Hardy)
Installing only the tweak tool did not work ('' schema com.canonical.notify-osd no installed''). As of July 2018, do the following:
sudo apt-get install notify-osd
sudo apt-get install --reinstall overlay-scrollbar
sudo apt install unity-tweak-tool


If you have a GUI running (the default Ubuntu desktop)
The launch it and set ''Overview -> Fonts'', Text scaling factor.
# Menu System->Administration->Hardware drivers
# Enable the driver (this will download the nvidia-glx-new package
# Reboot


Then:
Firefox and Thunderbird: Do as explained in the previous section (Ubuntu 16). That being said, after changing the params in Firefox then ones in Thunderbird did change too. Rather freaky.
# Menu: System->Preferences
# Screen resolution (works with a 1920x1200 screen)


Then add your second monitor if you got one:
=== Lock Screen ===
# Read [https://help.ubuntu.com/community/NvidiaMultiMonitors Nvidia Multi Monitors] first
# Install the nvidia settings tool, in a terminal type this (or get via the synaptic)
sudo apt-get nvidia-settings


Then use this tool to configure
You could set "turn off" and "sceen lock" through the standard GUI tool "Brightness and Lock". However, the max. amount you can input is 60 minutes for both.
* Menu System->Administration->Nvidia X Server settings


I do not want the default twin view, i.e. I want to be able to switch to a different workspace in one screen and keep the current one. So I went for two different screens
to change in terminal to blacken after 1 hour and to lock after 2 hours:
* XServer Display Configuration:
** Click on '''configure...'' and select twin view
gsettings set org.gnome.desktop.session idle-delay 3600
** Than play with the options until it looks good
gsettings set org.gnome.desktop.screensaver lock-delay 7200


Hit ''apply'' and if required CTRL-ALT BACKSPACE to restart the XServer.
Check the settings:
* I noticed that at some point it couldn't overwrite the /etc/X11/xorg.conf file. Look at the preview and then copy paste , i.e. open an editor under root :)
gsettings get org.gnome.desktop.screensaver lock-delay
gsettings get org.gnome.desktop.screensaver idle-delay


Anyhow this is a start, but some manual tweeking seems to be necessary
=== Trouble ===


'''Warning''':
'''Cannot not see the desktop'''
* this tool will append to the current xorg file by default. I.e. you may several conflicting definitions if you don't watch out.
* On the other hand if you don't append, your keyboard definition is gone, i.e. you have to know how to type US style. Make backups !!


See below for tweaking and repairing ...
You could try to deinstalling the current driver and replace by a new one. See above.


; The hard way
As of April 2017, you will get strange window decorations, fuzzy around the edges. Workaround: Restart the window manager
compiz --replace


Depending on the day (if it's rainy or sunny or the particular Ubuntu version) installing an Nvidia driver can be an absolute nightmare. If things fail, it is probably a good idea to:
Solution (maybe). Download the latest driver (see above)
* Make a copy of your /etc/X11/xorg.conf file
sudo apt install nvidia-381
* Remove everything that has to do with Nvidia
This will ask again to confirm that secure boot is disabled
** E.g. even drastic and dangerous ''apt-get remove nvidia*''
reboot
** it also can mean to remove manually files and other stuff (see various forums)
... and answer the funny questions
* Also the machine needs to completely halted at some point and be restarted in recovery mode (Hit ESC when linux starts loading)
* Make sure you can get a terminal (local or remote)
** Make sure you have another machine nearby, e.g. Windows with a putty (ssh client) installed.
** Hit ctrl-alt-F5 to enter a terminal mode or see above.
** Avoid removing power (reset) ... this can damage files, try ctrl-alt-delete first (or a halt from a remote terminal)
* Log files
** Look at the log files, in particular /var/log/Xorg.0.log and search for "(EE)".
** It's likely that your keyboard won't work. E.g. if you use special characters in your password you must know the layout of the US keyboard. That can be fixed again in the xorg.conf file.
** X also remembers stuff in your personal home directory and there are logs too.


Anyhow, if by miracle, things go well, here is the rough procedure:
After installing
sudo apt-get autoremove


(0) Make sure you got a nvidia card, type:
'''System cannot wakeup after a longer suspend''',
  lspci | grep -i nvidia


(1) You need to download the Nvidia driver.
* the screen remains black, using magic keys like CTL-ALT F4 won't work
* You may see an "entering Power save mode"


* Either from [http://www.nvidia.com/object/unix.html Nvidia]. E.g. file NVIDIA-Linux-x86-1.0-9755-pkg1.run
* Read [https://askubuntu.com/questions/1032633/18-04-screen-remains-blank-after-wake-up-from-suspend this]
: Edit /etc/default/grub
: Modify GRUB_CMDLINE_LINUX="" to GRUB_CMDLINE_LINUX="nouveau.modeset=0"
: sudo update-grub


* Or via apt (a package manager), this is the better solution if it works:
  sudo apt-get install nvidia-glx-new
.. or maybe nvidia-glx (the older version)


(2) Save the xorg.conf file
You also can try hitting the SHIFT key a lot and then press CTRL-ALT-F1 (log in again)
  cp /etc/X11/xorg.conf /etc/X11/xorg.conf.save1


(3 - manual install) Install the driver (in case you got it from Nvidia only !)
=== Configuration ===
  sh NVIDIA-Linux-x86-1.0-9755-pkg1.run


(4) Run the X server configurator (but make '''sure''' you have a copy of your old xorg.conf file !!)
Search System settings, then Displays. Ubuntu should autodetect your monitors. You then can change resolution, rotation and position for each.
nvidia-xconfig


There exist [http://linux.die.net/man/1/nvidia-xconfig options] which are described in the man page. Type
For more advanced settings, search CompizConfig in the Dashboard, or type ccsm. You may have to install it and '''if you have a double monitor configuration, you must install the extras'''
  man nvidia-xconfig


(5) The result won't do it, but it's a start. You have to hand-edit and
sudo apt-get install compizconfig-settings-manager compiz-plugins-extra
merge information from the old xorg.conf.save1 file !!!
ccsm &


You also can try to install the nvidia graphics control panel
* Click on Window Management
  apt-get install nvidia-settings
* Tick "Put" (for double monitor)
and run the config. utily (on the desktop)
gksu nvidia-settings


A particular nasty bug in the installation script is the name of the driver. If you use the ubuntu distribution, '''the driver's name may be "nv"''' and not '''nvidia'''. Remember this when your system wants to boot into low resolution mode.
In addition you could change the hot key for switching.


E.g. At some point I had this (I am minimalist and hate configuration work, so I stop when it works). I.e. if you want a single display for both monitors (you can drag stuff from monitor to the other) you '''only''' need to define one screen and one monitor. So, below there may some not used or even slightly harmful stuff (e.g. I have to check refresh rates).
... Having to install an advanced configuration tool with advanced extras is totally ridiculous. Under Windows adding a second monitor is plug and play. Under Ubuntu this takes 1 hour ore more to figure out.
<pre>
Section "ServerLayout"
Identifier    "Default Layout"
Screen        "Screen0" 0 0
InputDevice    "Generic Keyboard"
InputDevice    "Configured Mouse"
InputDevice    "stylus" "SendCoreEvents"
InputDevice    "cursor" "SendCoreEvents"
InputDevice    "eraser" "SendCoreEvents"
EndSection


Section "Files"
=== Ubuntu Nvidia Quadro FX + 2 digital monitors ===
# path to defoma fonts
FontPath        "/usr/share/X11/fonts/misc"
FontPath        "/usr/share/X11/fonts/cyrillic"
FontPath        "/usr/share/X11/fonts/100dpi/:unscaled"
FontPath        "/usr/share/X11/fonts/75dpi/:unscaled"
FontPath        "/usr/share/X11/fonts/Type1"
FontPath        "/usr/share/X11/fonts/100dpi"
FontPath        "/usr/share/X11/fonts/75dpi"
FontPath        "/usr/share/fonts/X11/misc"
FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection


Section "Module"
Recent Ubuntu editions handle Quadro cards quite well (iff and after you managed to install the system, see above). Just use the display tool in the systems settings.
Load          "i2c"
Load          "bitmap"
Load          "ddc"
Load          "extmod"
Load          "freetype"
Load          "glx"
Load          "int10"
Load          "type1"
Load          "vbe"
EndSection


Section "InputDevice"
In case you are interested in older versions of Ubuntu, see the [https://edutechwiki.unige.ch/mediawiki/index.php?title=Ubuntu_installation&oldid=40454 wiki history of this article].
Identifier    "Generic Keyboard"
Driver        "kbd"
Option        "CoreKeyboard"
Option        "XkbRules" "xorg"
Option        "XkbModel" "pc105"
Option        "XkbLayout" "ch"
Option        "XkbOptions" "lv3:ralt_switch"
Option        "XkbVariant" "fr"
EndSection


Section "InputDevice"
=== Displaying remote programs with X11 ===
Identifier    "Configured Mouse"
Driver        "mouse"
Option        "CorePointer"
Option        "Device" "/dev/input/mice"
Option        "Protocol" "ExplorerPS/2"
Option        "ZAxisMapping" "4 5"
Option        "Emulate3Buttons" "true"
EndSection


Section "InputDevice"
According to this [http://unix.stackexchange.com/questions/110558/su-with-error-x11-connection-rejected-because-of-wrong-authentication/118295 Stackexchange], If you are root on another machine and you get " X11 connection rejected because of wrong authentication." try the following (worked for me)
# /dev/input/event
# for USB
Identifier    "stylus"
Driver        "wacom"
Option        "Device" "/dev/wacom"         # Change to


Option        "Type" "stylus"
ssh remote_host -XY -luser
Option        "ForceDevice" "ISDV4"              # Tablet PC ONLY
sudo su
EndSection
cd
xauth merge /home/user/.Xauthority


Section "InputDevice"
== Install fonts ==
# /dev/input/event
# for USB
Identifier    "eraser"
Driver        "wacom"
Option        "Device" "/dev/wacom"          # Change to


Option        "Type" "eraser"
Most fonts one can download are zipped
Option        "ForceDevice" "ISDV4"              # Tablet PC ONLY
EndSection


Section "InputDevice"
'''Install with the font manager'''
# /dev/input/event
# for USB
Identifier    "cursor"
Driver        "wacom"
Option        "Device" "/dev/wacom"          # Change to


Option        "Type" "cursor"
* extract the files
Option        "ForceDevice" "ISDV4"              # Tablet PC ONLY
* Most fonts are either in TTF (true type font) or OTF (Open Type Font)
EndSection
* In the file manager, double click on each file. In Ubuntu 16, fonts will be installed in the ''~/.local/share/fonts directory''. Since this can take time, see the next item.


Section "Monitor"
'''Install by copying'''
Identifier    "Monitor0"
* Put them into the ''~/.local/share/fonts'' directory or the ''/.fonts'' directory
HorizSync      28.0 - 51.0
VertRefresh    43.0 - 60.0
Option        "DPMS"
EndSection


Section "Monitor"
'''Install system wide'''
Identifier    "Monitor1"
apt install fontconfig
HorizSync      28.0 - 51.0
* copy font files to ''/usr/local/share/fonts''
VertRefresh    43.0 - 60.0
* <code>sudo fc-cache -f -v</code>
Option        "DPMS"
EndSection


Section "Device"
== Sounds / Bell / beep ==
Identifier    "NVIDIA Corporation NV41 [Quadro FX 3450/4000 SDI]"
Driver        "nvidia"
Option "DPMS"
#DKS (5 lignes)
Option "TwinView" "Yes"
Option "TwinViewOrientation" "LeftOf"
Option "SecondMonitorVertRefresh" "56-76"
Option "SecondMonitorHorizSync" "31-80"
Option "MetaModes" "1920x1200,1600x1200; 1920x1200,NULL"
EndSection


Section "Screen"
By default, Ubuntu disables the beep in terminals
Identifier    "Screen0"
Device        "NVIDIA Corporation NV41 [Quadro FX 3450/4000 SDI]"
Monitor        "Monitor0"
DefaultDepth    24


SubSection    "Display"
To get it back (according to [http://askubuntu.com/questions/228096/terminal-bell-doesnt-ring this])
Viewport    0 0
* Run gconf-editor and if the desktop | gnome | peripherals | keyboard | bell_mode setting is present then change it from off to on.
Depth      24
* Add <code>pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg</code> to the file ~/.xprofile
* Add <code>[ "$DISPLAY" ] && xset b 100</code> to the file ~/.bashrc


Modes      "1920x1200" "1600x1200"
To get a bell in Emacs, read [https://www.emacswiki.org/emacs/AlarmBell AlarmBell]
EndSubSection
# not really needed, but some games may want this
SubSection    "Display"
Viewport    0 0
Depth      16
Modes      "1920x1200" "1600x1200"
EndSubSection
EndSection


Section "Screen"
== Desktop ==
Identifier    "Screen1"
 
Device        "NVIDIA Corporation NV41 [Quadro FX 3450/4000 SDI]"
=== Change window control buttons ===
Monitor        "Monitor1"
 
DefaultDepth    24
By default the window control buttons are to the left in Ubuntu 10.04 LTS - the Lucid Lynx - released in April 2010 (annoying for older people like me who don't want to retrain procedures for no good reason).
SubSection    "Display"
 
Depth      24
To fix this, i.e. move the control buttons to the right as before: Press ALT-F2 or open a terminal and type ''gconf-editor''. Navigate to /apps/metacity/general and change the button_layout to ''':minimize,maximize,close'''  (the '':'' must be in front).
Modes      "1600x1200" "1280x1024" "1024x768" "800x600" "640x480"
 
EndSubSection
Of course, you also could specify '':maximize,minimize,close'' ....
EndSection
</pre>
Make sure that there are no syntax errors, and that you have and empty line at the end of this file.


== Hot keys for the brave ==
== Hot keys for the brave ==
Line 423: Line 679:
So your GUI is stuck ....
So your GUI is stuck ....


To open a console terminal (no GUI):
To open a console terminal (no GUI), new login
  CTRL-ALT F1
  CTRL-ALT F3 to CTRL-ALT F7
... same for F2 to F6 (so you can have 6 different terminals)
 
Warning: In Ubuntu 16 one could use CTRL-ALT F1 etc. but '''that does no longer work !!'''
 
Then you can for instance restart the Window manager:
sudo restart lightdm


To go back to the desktop:
To go back to the desktop (Ubuntu 16)
  CTRL-ALT F7
  CTRL-ALT F7
To go back to the desktop (Ubuntu 16)
CTRL-ALT F2


To see boot system messages
To see boot system messages
Line 438: Line 701:
== Packages ==
== Packages ==


Basically, an end-user can do all this stuff with a GUI tool, i.e. the synaptic package administrator. However it is good to know a few command line things for 2 reasons:
Basically, an end-user can do most of this stuff with a GUI tool, i.e. the synaptic package administrator. However it is good to know a few command line things for 2 reasons:
* You may have damaged your desktop when trying to install a new video driver
* You may have damaged your desktop when trying to install a new video driver
* It's sometimes faster. In particular when you see on some website that this and this package should be installed in this and that order ...
* It's sometimes faster. In particular when you see on some website that this and this package should be installed in this and that order ...


A list of command-line stuff (you must be root or add "sudo" in front of each). Sometimes there are equivalent commands for agt-get and aptitude. See the [http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html apt howto] at Debian.
A list of command-line stuff (you must be root or add "sudo" in front of each). Sometimes there are equivalent commands for abt-get and aptitude. See the [http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html apt howto] at Debian.
 
=== Installing packages from a package archive ===


; To fix the ubuntu archive mirrors  
; To fix the ubuntu archive mirrors  
Line 461: Line 726:
To find a package XXX
To find a package XXX
   aptitude search XXX
   aptitude search XXX
; Installing
apt-get install XXX
If this fails because of dependency issues, you then can try:
apt-get -f install


; Cleaning and such
; Cleaning and such
Line 496: Line 767:
   apt-get update
   apt-get update
   apt-get dist-upgrade (or whatever you planned to install)
   apt-get dist-upgrade (or whatever you planned to install)
=== Installing deb files ===
Sometimes, software is distributed as package for download, i.e. a *.deb file
To install it:
  dpkg -i XXX.deb
If you run into dependency error messages you'll have to add packages (no problem) or remove packages (avoid !).
Example (for the [[eXe]] eLearning authoring system):
  dpkg -i python2.5-exe_1.04.0.3532-ubuntu1_i386.deb
will give:
  Unpacking python2.5-exe (from python2.5-exe_1.04.0.3532-ubuntu1_i386.deb) ...
  dpkg: dependency problems prevent configuration of python2.5-exe:
  python2.5-exe depends on python-zopeinterface (>= 3.0.0-6); however:
  Package python-zopeinterface is not installed.
  dpkg: error processing python2.5-exe (--install):
  dependency problems - leaving unconfigured
First thing to do is to try something like:
  apt-get install python-zopeinterface
=== Information about packages ===
'''xxx''' is the package name or package file (*.deb) name
; Getting information about a package
apt-cache search xxx
apt-cache showpkg xxx
apt-cache show xxx
; To find a package on your system, if you know a file name
dpkg -S xxx_file_name
or
apt-file search filename
; To list all packages and search for a name.
dpkg -l | grep xxx
; To extract a deb file without really installing it
dpkg --unpack xxx.deb
; To list the contents of a package file
dpkg -c xxx.deb
=== Holding packages ===
In theory:
apt-make hold packagename
However, this doesn't seem to work as expected, i.e. Ubuntu will try to update dependencies of a package that you not want to upgrade. For exemple if your package uses and old Java, it will try to update it, although it is gone from the repository.
Edit file /var/lib/dpkg/status
* Remove unwanted old packages from <code>Dependencies:</code>
=== Boot files ===
Identify the kernel you currently use:
uname -r
List all installed images:
  dpkg -l linux-image-\* | grep ^ii
If the following does not work (e.g. because the file partition is full):
sudo apt-get purge linux-image-3.2.0-55
try:
sudo dpkg --purge linux-image-3.2.0-55-generic
... etc.
Then, in order to complete a previous failed installation:
sudo apt-get -f install
Finally, now clean a whole lot of other old ones, eg.
sudo apt-get purge linux-image-3.2.0-58 linux-image-3.2.0-59 linux-image-3.2.0-60 linux-image-3.2.0-61
And remove other stuff you don't need
sudo apt-get autoremove
== Other types of software packages ==
There exist several other distribution mechanisms, such as flatpack or appimages
=== Appimages ===
App images contain all the libraries needed to run an application. It therefore should run on most Linux systems.
To use:
* Download
* Change permission to +x
* Run it
For better integration, read [https://itsfoss.com/use-appimage-linux/ this]. In short, install AppImageLauncher. If you click on an appimage in the filemanager, it will copy it to a specific directory and integrate it in the system, e.g. you can dock the application later.
sudo add-apt-repository ppa:appimagelauncher-team/stable
sudo apt update
sudo apt install appimagelauncher
This only will work with clean appimages. Those that are broken and need extra paramters do no seem to work. E.g. mendeley needs an extra --no-sandbox parameter.
./mendeley-reference-manager-2.84.0-beta.0-x86_64_cb2cce94615522bfd12079b8bad4cd8b.AppImage --no-sandbox &


== Printers ==
== Printers ==
Line 501: Line 874:
Printers don't necessarily work automatically either:
Printers don't necessarily work automatically either:


A good bet is to use this application:
Before connecting a network printer, it is likely that you need a a PPD file (a file that defines properties of your postscript printer). Get it from:
 
* http://localhost:631/admin
 
Before you do so, it is like that you need a a PPD file (a file that defines properties of your postscript printer). Get it from:
* http://openprinting.org/printer_list.cgi
* http://openprinting.org/printer_list.cgi


=== Example Infotec ===
=== Example Infotec ===
(this needs to be verified)


Example for Infotec ISC 1032 (A low end color copy and printer machine)
Example for Infotec ISC 1032 (A low end color copy and printer machine)
Line 518: Line 889:
* Finally configure the printer (e.g. define paper size, trays and stuff).
* Finally configure the printer (e.g. define paper size, trays and stuff).
* If CUPs printing doesn't work, use "HP JeDirect" and port 9100.
* If CUPs printing doesn't work, use "HP JeDirect" and port 9100.
=== Different Ubuntu user name ? ===
Read [https://askubuntu.com/questions/61095/use-different-username-on-cups-remote-printing Use different username on CUPS remote printing]
Summary (Quoted from above)
According to the man page https://www.cups.org/doc/man-client.conf.html, a User directive could be placed in /etc/cups/client.conf or ~/.cups/client.conf
However, this didn't work for me in Kubuntu Trusty. What worked, was to export the CUPS_USER environment variable by adding the following line in ~/.profile:
export CUPS_USER=vangelis


== X Windows ==
== X Windows ==


We run a few sun servers and I prefer to run emacs (gui) on a remote machine instead of mounting all these file systems. Also I prefer to have a root terminal open instead of typing 'sudo' all the time. If you want allow for this:
We run a few sun servers and I prefer to run emacs (GUI) on a remote machine instead of mounting all these file systems. Also I prefer to have a root terminal open instead of typing 'sudo' all the time. If you want allow for this:


; Reconfigure the window manager (gdm)
; Reconfigure the window manager (gdm)
Line 536: Line 918:
* To allow somebody on a different machine, type:
* To allow somebody on a different machine, type:
  xhost + xxx.yyy.zzz
  xhost + xxx.yyy.zzz
* It's important not to to type 'xhost +'. Since anyone may then connect to your screen. However, type xhost + something is boring, so it's more practical to edit /etc/X0.hosts. Just put the names or ip numbers of authorized machines there.
* It's important not to to type 'xhost +'. Since anyone may then connect to your screen. However, type xhost + something is boring, so it's more practical to edit /etc/X0.hosts. Just put the names or IP numbers of authorized machines there.


;If it doesn't work
;If it doesn't work
Line 555: Line 937:
== Java ==
== Java ==


By default Ubuntu comes with some Java 1.4 compatible version that is free. For some applications though, you need Java 5 or 6 from Sun
By default Ubuntu comes with some Java compatible version that is free. For some applications though, you need Java 7 or 8 from Oracle (Java formerly was made by Sun)
 
=== Java 11 ===
(tested with Ubuntu 18 LTS)
 
There are several repositories from which you can get an installer. Alternatively, you could [https://www.oracle.com/technetwork/java/javase/downloads/index.htmldownload Java from Oracle] and install it manually.
 
Read this:
* https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-18-04
* https://thishosting.rocks/install-java-ubuntu/
 
  sudo apt update
  sudo apt upgrade
 
.....
 
=== Java 8 ===
(tested with Ubuntu 14.x LTS)
 
Read this:
* http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
 
Install it:


* Read this: https://help.ubuntu.com/community/Java
sudo add-apt-repository ppa:webupd8team/java
** Summary: You can get Sun Java as Ubuntu package, if you have multiverse enabled.
sudo apt-get update
** You also then should consider making the Sun version the default (also explained in the above doc).
sudo apt-get install oracle-java8-installer


== Sound ==
Test it:
java -version


Sound may not work either.
You should see something like
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)
 
=== Managing several version ===
 
Several java version can be managed through script, but at the system level there is a simpler solution
 
sudo update-alternatives --config java
 
=== Java in Firefox ===
 
Installing Java does not install a plugin in Firefox. Java is needed for many institutional applications and in addition there are many interesting applets for education. So let's go. Make sure that Java is installed on your machine (e.g. see above for Oracle Java).
 
'''For old Firefox version'''
 
The following will not work with a recent Firefox )> 53 I believe)
 
Install a a Firefox plugin that should enable a currently installed Open Java (did not work for me)
sudo apt-get install icedtea-plugin
 
Create a symbolic link to the Oracle plugin from the Firefox plugin directory (did not work for me)
cd /usr/lib/firefox-addons/plugins
ln -s /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libnpjp2.so
 
'''Install the Firefox ESR version''' (this works)
 
It seems that the only way to have Java under Linux is to install an old version of Firefox. The "ESR" version was made for just this purpose.
* Download [https://www.mozilla.org/en-US/firefox/organizations/all/ firefox ESR]
* Unpack the bz file somwhere, e.g. in  ~/bin/firefox
tar xjvf firefox-52.2.0esr.tar.bz2
mv firefox ~/bin/
 
Then launch it like so:
~/bin/firefox/firefox --new-instance -P ESR
: this is important I believe. You should not mess with your default profile that you use with your regular new version of firefox. This version is just for messing with Java applets.
 
== Sound and music ==
 
Since Ubuntu 16LTS, sound works rather well. The only problem is figure out how to hook up the external speakers (see the display section for that)
 
=== Music services ===
 
Music services through the browser may not work (google for solution).
 
E.g. to use Amazon cloud music, read [https://nuvola.tiliado.eu/nuvola/ubuntu/bionic/ this]
 
Nuvola is available through flatpak, a kind of app distributor that works across various OSs.
sudo apt-get install flatpak xdg-desktop-portal-gtk gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists nuvola https://dl.tiliado.eu/flatpak/nuvola.flatpakrepo
flatpak update
flatpak install nuvola eu.tiliado.Nuvola
 
The launch flatpak and find the nuvola amazon cloud player. Click on install.
 
This worked for me (Ubuntu 18, using Amazon France from my workplace in Switzerland). Listening to Lazy Bird from John Coltrane while writing this.
 
=== Crackling sound in Ubuntu 18 ===
 
After installing Ubuntu 18 it became impossible to listen to Music. Something that pulseaudio does seems to be the reason.
 
killall pulseaudio
 
Caveat: Needs to be repeated each time you reboot.
 
The next solution also seems to work (various forums give this solution)
 
1) Edit file
/etc/pulse/default.pa
 
2) Change line
  load-module module-udev-detect
to
load-module module-udev-detect tsched=0
 
3) Then restart
 
pulseaudio -k
pulseaudio --start
 
Notice: Removing pulseaudio from the system does not seem to be a great idea.
 
=== Tips of older Ubuntus ===
 
In older Ubuntu distributions (e.g. LTS 12) sound may not work either.


* Install all the ALSA stuff (e.g. via the synaptic package manager)
* Install all the ALSA stuff (e.g. via the synaptic package manager)
* Then test with Menu System->Preferences-Sound
* Then test with Menu System->Preferences-Sound
* Then set the right default volume with Menu Applications->Sound and Video->ALSA Mixer GUID ('''in particular PCM''' ! It may be as simple as that ...)
* Then set the right default volume with Menu Applications->Sound and Video->ALSA Mixer GUID ('''in particular PCM''' ! It may be as simple as that ...)
=== Sound trouble ? ===


If sound doesn't work search the Ubuntu forums: http://ubuntuforums.org/. A particular good overview posting was:
If sound doesn't work search the Ubuntu forums: http://ubuntuforums.org/. A particular good overview posting was:
Line 593: Line 1,082:
  lsmod
  lsmod
If I understand right, drivers are kernel modules.
If I understand right, drivers are kernel modules.
=== Give permission to insecure web sites ===
Nearly no Java Web site will run once you enabled Java.
Give these sites permission (of course, only do that with your local administration or non-local friendly educational applications...)
jcontrol &
: Security tab.
== Application hints ==
=== Rhythmbox ===
To edit a playlist (i.e. reorder items), there are two options
* You can drag items up and down (untick "browse" in the View menu, if you need more space)
* You can edit the XML (better for very large lists, maybe do a save before you do this)
.local/share/rhythmbox/playlists.xml
Also, it's a good idea to remember that you can copy this file, if you decide to re-install your machine and start with a clean/new setup
=== Who else has Linux nearby ? ===
sudo nmap -O xxx.yyy.zzz.1-255 | grep "Running: " | sort | uniq -c


== Non-standard software ==
== Non-standard software ==
Line 598: Line 1,109:
Some organization maintain their own Debian/Ubuntu package servers.
Some organization maintain their own Debian/Ubuntu package servers.


=== Mediabuntu ===
=== Dropbox ===
 
Works quite well on Ubuntu 22
 
If it does not, try ''man dropbox'', e.g.
 
dropbox status
dropbox start
dropbox update
 
=== Screenshots ===
 
Most people did agree that [http://shutter-project.org/ Shutter] was the  best tool
  sudo apt install shutter
: Shots can be edited and annotated with a built-in editor.
: To install as default, read [http://shutter-project.org/faq-help/set-shutter-as-the-default-screenshot-tool/ this], Before you can assign the PrtScreen button, you must reset the existing shortcut using backspace.
: Tip: Double click when using selection.
 
Since Ubuntu 18, there is also [https://github.com/lupoDharkael/flameshot Flameshot], but unless I missed something it cannot do text.
  sudo apt install flameshot
: to launch it, type
  flameshot gui
: The edit will directly appear in the shot.
 
Neither is as good as Greenshot for Windows IMHO, but both are OK. Since Flameshot is new, it might have bugs (I do not know)
 
=== Shotcut ===
 
[https://www.shotcut.org/ Shotcut] is a cross platform free video editor which has good rankings (also on Windows). Tested on oct. 2017 with Ubuntu 16x.
 
There are different ways to install it. I chose a PPA distribution that seems to be trustworthy. I also had to add a missing library after installing.
 
sudo add-apt-repository ppa:haraldhv/shotcut
sudo apt-get update
sudo apt install shotcut
 
First time, launch it in the terminal so you can spot errors if there are.
shotcut
 
Install [http://www.libsdl.org/ this one] before if you do not have it.
sudo apt-get install libsdl2-2.0
 
=== Mendeley ===
 
Mendeley, the bibliography and article manager does have a Debian distribution.
 
Read [https://www.mendeley.com/download-mendeley-desktop/ubuntu Download Mendeley Desktop for Ubuntu].
 
* Click on the [https://www.mendeley.com/download-mendeley-desktop/debian/instructions/ download link]
* Install from the package manager that should open
 
Run it:
mendeleydesktop &


Read this:
Also, install the libre office and web browser plugins if not already done so.
* http://www.futuredesktop.org/
* https://help.ubuntu.com/community/Medibuntu


=== Skype ===
=== Skype ===
Line 612: Line 1,174:
* Install the skype package.
* Install the skype package.


== Opinions ==
=== Google Chrome ===
 
Read [https://askubuntu.com/questions/510056/how-to-install-google-chrome How to install Google Chrome] (askubuntu)
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
 
== Security ==
 
* http://denyhosts.sourceforge.net/faq.html
 
; SSH Keys
* [http://blog.patshead.com/2013/09/generating-new-more-secure-ssh-keys.html Generating New, More Secure SSH Keys] by Pat Regan
* [http://martin.kleppmann.com/2013/05/24/improving-security-of-ssh-private-keys.html Improving the security of your SSH private key files] by Martin Kleppmann
 
; Firewall
 
Show
sudo ufw status
sudo ufw --help
 
To allow port 7777 for tcp for everyone:
sudo ufw allow 7777/tcp
 
To allow port 2049 for TCP and UDP for a given IP (replace your_ip_number with your IP number)
sudo ufw allow from your_ip_number to any port 2049 proto tcp
sudo ufw allow from your_ip_number to any port 2049 proto udp
 
To allow everything from a given IP
sudo ufw allow from ''ip_number_here''
 
After that, reload the firewall:
sudo ufw reload
 
To disable / enable
sudo ufw disable
: E.g. for testing purposes ....
sudo ufw enable
 
== Opinions and alternatives ==


Add yours ...
Add yours ...
Line 618: Line 1,220:
=== DKS ===
=== DKS ===


* [[User:Daniel K. Schneider|Daniel K. Schneider]] uses Ubuntu since March 2007, because he got fed up with Mandriva updates not working correctly. I hate '''all''' OS's (Unix, Mac, Win) but prefer to work on Unix because it's fairly stable and appropriate for what I do. I also do have Windows machines (a Dell XP II and Acer tablet PC) for doing stuff that needs Win. (E.g. wordprocessing with Framemaker, X3D, Games). Our servers (e.g. for this wiki) run under Solaris. More difficult to install, but reliable on the other hand.
* [[User:Daniel K. Schneider|Daniel K. Schneider]] uses Ubuntu since March 2007, because he got fed up with Mandriva updates not working correctly. I hate '''all''' OS's (Unix, Mac, Win) but prefer to work on Unix because it's fairly stable and appropriate for what I do. I also do have Windows machines for doing stuff that needs Win 7. (E.g. Flash, word processing with Framemaker, X3D, Games). Our servers (e.g. for this wiki) run mostly under Ubuntu too. Before we ran Solaris which is much more difficult to install and maintain but extra solid.


* Indeed (it's now August 2007 and I went through a major upgrade) I find that Ubuntu and its packaging system is far more robust. Though I once failed with a non supported package, i.e. Cinelerra that I got from another site. It installed, but crashed on start. Have to try again at some point.
* Indeed (it's now August 2007 and I went through a major upgrade) I find that Ubuntu and its packaging system is far more robust. Though I once failed with a non supported package, i.e. Cinelerra that I got from another site. It installed, but crashed on start. Have to try again at some point.


* Other remarks: The official Ubunto Gnu Emacs installation is the "Leim" version, i.e. it can be used to edit UTF-8 text (I am writing my wiki entries with this).
* If your applications crash (e.g. Firefox) '''check your bloody RAM'''. It may be defective and you can loose 3 days of work trying to reinstall when there is absolutely no need. Ubuntu '''is''' solid, even if the installation can be messy !
 
* I don't like the new 12.04 Desktop. Not very efficient for people who know what they are doing (see the installation notes on top)
 
=== Alternatives ===
 
* [http://www.linuxmint.com/ Linux Mint], can be described as some kind of easier to use Ubuntu. There is also a '''Linux Mint Debian Edition''' that is directly based on Debian and it may be of interest to people who want to be closer to Debian. Both editions should behave in the same way.  Read the [http://en.wikipedia.org/wiki/Linux_Mint Wikipedia] article and [http://www.h-online.com/open/features/Linux-Mint-15-A-better-Ubuntu-for-the-desktop-1873682.html Linux Mint 15 A better Ubuntu for the desktop] (May 2013).
 
* If you dislike Unity (the standard Ubuntu 12x desktop) you also could just user another one, e.g. Cinnamon. Read [http://community.linuxmint.com/tutorial/view/1246 how to Install latest Cinnamon 1.6.4 in Ubuntu 12.10/12.04/Linux Mint]
sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get install cinnamon
Then, log out and you will have the option to use Cinnamon. The normal Ubuntu Desktop will remain there and you can therefore switch back easily....


== Links ==
== Links ==
Line 633: Line 1,247:


; Other
; Other
* http://www.cs.cornell.edu/~djm/ubuntu/
 
* http://ubuntuguide.org/wiki/Ubuntu_Edgy
* http://ubuntuguide.org/


[[Category: Installation tips]]
[[Category: Installation tips]]

Latest revision as of 20:02, 29 November 2023

Ubuntu

Ubuntu is a popular Linux distribution, best suited for desktop computers. It is based on Debian, therefore the packaging (*.deb) works rather well.

Disclaimers

  • This page so far is by no means a configuration and installation guide, but it contains some information that could be of use to some people. Daniel K. Schneider decided to put some of his installation notes in this wiki, so he won't loose them.
  • I am be no means a systems expert. As you can see from other entries in this wiki I deal with lots of stuff and lots of it I don't really master ...
  • Feel encouraged to add stuff :)

Identify your machine and system

Find out what distribution you already have:

more /etc/issue
uname -a

Find the serial number for your machine (e.g. a Dell service tag)

sudo dmidecode -s system-serial-number
However, this may not work. E.g. on my new Dell Precision tower, this fails (as of June 2017)

Installation documentation

Start with the official Ubuntu site (sometimes a bit lengthy):

Sometimes it is useful to hunt down short installation documentation on other sites than Ubuntu. If you are looking for an other practical, short and excellent installation guides (and that may include how to add non-free software):

After installing (Thanx a lot to you guys, the articles below really did help me to get a somewhat decent working environment - Daniel K. Schneider 22:06, 20 September 2012 (CEST))

Upgrading Ubuntu 18.04 to 20.04x to 22.04 LTS

Firstly upgrade to the latest 18.04

sudo apt update
sudo apt upgrade

Then do it

sudo do-release-upgrade

I did the 20.04 LTS upgrade on June 3 2021 and it worked without any extra work, including my double screen configuration. Maybe because I got an older PC, but I am still happy :) The whole procedure took about 90 minutes where I had to answer a few questions, using the default answer.

lsb_release -a

LSB Version:	core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

In 2023 I upgraded from 20.04 to LTS 22.04 without problems.

LSB Version:	security-11.1.0ubuntu4-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy

Upgrading Ubuntu 16.04 to 18.04 LTS

For major update, I strongly suggest waiting until the official update path is cleared, i.e. wait until sudo do-release-update works. I once forced the install and it miserably failed. So I had to install a new system and that went well (I only to change my uid/gid and mount server partitions again and, of course, reinstall all the software, but that was extra work ....)

Firstly upgrade to the latest 16.04

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove

Early adopters:

sudo do-release-upgrade -d

else

sudo do-release-upgrade

Upgrading a desktop

I tried before the official upgrade and it broke the system (the same as described for version 16.x below)

The process broke in the middle since some dependencies were not met.... For now I don't know if this can be fixed.

sudo apt install -f
Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... failed.
The following packages have unmet dependencies:
 glib-networking : Depends: libglib2.0-0 (>= 2.55.0) but 2.48.2-0ubuntu1 is installed
 glib-networking-services : Depends: libglib2.0-0 (>= 2.55.0) but 2.48.2-0ubuntu1 is installed
 gnupg : Depends: gnupg-l10n (= 2.2.4-1ubuntu1.1) but it is not installed
         Depends: gnupg-utils (= 2.2.4-1ubuntu1.1)
         Depends: gpg (= 2.2.4-1ubuntu1.1)
         Depends: gpg-wks-client (= 2.2.4-1ubuntu1.1)
         Depends: gpg-wks-server (= 2.2.4-1ubuntu1.1)
         Depends: gpgsm (= 2.2.4-1ubuntu1.1)
         Depends: gpgv (= 2.2.4-1ubuntu1.1)
         Breaks: python3-apt (<= 1.1.0~beta4) but 1.1.0~beta1ubuntu0.16.04.1 is installed
         Breaks: software-properties-common (<= 0.96.24.3) but 0.96.20.7 is installed
 libc6-dbg : Depends: libc6 (= 2.23-0ubuntu10) but 2.27-3ubuntu1 is installed
 libc6-i386 : Depends: libc6 (= 2.23-0ubuntu10) but 2.27-3ubuntu1 is installed
 libgail-3-0 : Depends: libglib2.0-0 (>= 2.49.4) but 2.48.2-0ubuntu1 is installed
 libglib2.0-bin : Depends: libglib2.0-0 (= 2.56.1-2ubuntu1) but 2.48.2-0ubuntu1 is installed
 libgoa-1.0-0b : Depends: libglib2.0-0 (>= 2.52) but 2.48.2-0ubuntu1 is installed
 libgoa-backend-1.0-1 : Depends: libglib2.0-0 (>= 2.52) but 2.48.2-0ubuntu1 is installed
 libgtk-3-0 : Depends: libglib2.0-0 (>= 2.55.2) but 2.48.2-0ubuntu1 is installed
 python-apt : Depends: libapt-inst2.0 (>= 1.4~beta3) but 1.2.26 is installed
              Depends: libapt-pkg5.0 (>= 1.4~beta3) but 1.2.26 is installed
 python3 : PreDepends: python3-minimal (= 3.5.1-3) but 3.6.5-3 is installed
           Depends: libpython3-stdlib (= 3.5.1-3) but 3.6.5-3 is installed
 python3-minimal : Depends: python3.6-minimal (>= 3.6.5-2~) but it is not installed
 python3.6 : Depends: python3.6-minimal (= 3.6.5-3) but it is not installed

Probably I first should try removing packages installed from a PPA, e.g. Inkscape.

https://askubuntu.com/questions/307/how-can-ppas-be-removed

Anyhow, I just killed the machine and installed a new 18 version. Reinstalling can be justified if you need several new software, e.g. Inkscape and do not want to upgrade these via an external PPA. Before you do so, backup your home and maybe some other configuration files.

Upgrading Ubuntu 14.04 to 16.04 LTS

This upgrade was available since July 21 2016 (16.04.1 LTS)

Upgrade to latest 14.04 (not sure that this is really needed)

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoremove

Upgrade to 16.04 LTS

sudo do-release-upgrade

If this doesn't work, try

sudo update-manager -d

Upgrading a DELL Precision tower

Even in April 2017, a high end DELL desktop workstation comes with Ubuntu 14LTS (pre-installed). I got a 5810 tower with a Xeon E5-1620 v3 (Four Core HT, 10MB Cache, 3.5GHz Turbo, a 500GB SSD and a NVIDIA® Quadro® M4000 8Go graphics card. That system does not want to upgrade, or at least mine would not.

Symptoms:

  • Doing the steps above broke the GUI (Can't log in anymore). This is not related to upgrading to 16LTS but still a big hassle (see below)
  • From a terminal (hit CTL-ALT-F1), the do-release-upgrade command won't find any upgrades. It says:
No new release found

Someone (at DELL) decided that you should not update, so iff you believe that you should upgrade, then change this setting even before any upgrading / updating to newer 14LTS packages.

  • Edit /etc/update-manager/release-upgrades and set Prompt=lts

If your system is new (like mine), you could use the Nano editor, e.g. type:

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

Now

sudo do-release-upgrade

This went pretty well, except that the the GUI was still broken. Nvidia drivers are proprietary and even if you install new ones from the graphics repository (see below), I could not login.

To fix that:

  • Disable secure boot (sorry I was too fed up to take notes, but), the most important part is;
  • run a terminal: CTL-ALT-F1, then type:
sudo update-secureboot-policy
  • Then enter a password you can remember, e.g. yours, and then immediately reboot. It will then ask you to enter the password you just gave in a weird way, character by character.

Now I could log into the system, but the there was no desktop (i.e. compiz was broken). There was only the graphics layer. With that you can still open open a terminal (right click) but it cannot be moved since compiz did not work. In order to get the control center, you could type in terminal:

unity-control-center --overview

... but there is nothing in there that would fixing the problem. However, you can create a new user (see below)

Solution: Kill yourself and get a new better self. Do do so:

  • Create a new user with root privileges, e.g. call it admin (and so make sure that he/she got these privileges !!)
  • Kill your user
  • Create a new one. Also consider getting good uid and gid values, e.g. the same that you would have on other machines in your network.

Comment:

  • This is not the first time I have trouble installing or upgrading a Linux desktop. Windows is so much easier. However once Ubuntu is up and running I feel more comfortable with it.
  • On the positive side, this DELL machine does seem to be fast, e.g. will load 3.5 Mio Meshes into Meshlab really fast. It even can play games through Steam. It also is very silent.

Ubuntu upgrades

Which version do I run

Type:

lsb_release -a

Minor upgrades

From the command line, to update the repository information:

sudo apt-get update

To upgrade

sudo apt-get dist-upgrade
will do the upgrade fairly smartly (make sure that all dependencies work)
sudo apt-get dist-upgrade
will upgrade the existing packages to the latest version

Hash Sum mismatch issues

If something like GPG error: http://mirror.switch.ch hardy-updates Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com> happens, you might change the server. Either,

  • Edit /etc/apt/sources.list

Or

  • change with menu System->Administration->Software sources

Or get a new key (2) Identify the missing ones

sudo apt-get update
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com XXXXXXXXXX
XXXXXXXXX is the missing key.

Major upgrades

  • You can upgrade from LTS to LTS (however that takes a little bit of waiting, e.g. 12.04 LTS will upgrade to 14.04.01
  • Upgrade first the existing installation
  • Clean repository information. I.e. remove those that don't work anymore (read this (command-line) or that (details, search for "removing").
apt-get dist-upgrade

To upgrade

do-release-upgrade -d

PHP/MySQL trouble with a 10.04 to 12.04 upgrade

  • Read this and similar. It helped. I had to force remove remove everything mysql before I could install a 5.5 version + all the other things that were remove (like php-mysql).
  • PHP can't find some extensions. Install these again, e.g.
apt-get install php5-gd php5-mcrypt php5-suhosin

Networking, file systems and users

Defining a fixed IP number

By default, a workstation will use numbers from DHCP and that should work without problems.

Alternatively, you also can, in some institutions, that DHCP always provides you with a fixed address. Ask. This solution works in our institution.

Finally, if you want to add manually a or several fixed IP numbers.

More simply, on a workstation, use the "Network" tool in the System settings. Click on Options, then the various tabs ...

Mounting external NFS partitions

Read more about this topic:

Installing mnt and mount points

It's a bad idea to keep your files on your personal PC. Since we have sun servers with daily backup I just mount partitions via NFS. NFS may not be included in your install

apt-get install nfs-common
mkdir /mnt/YYY

then edit /etc/fstab and enter line(s) like this

XXX.unige.ch:/export/home /mnt/YYY nfs defaults 0 0

Then mount these

mount -a

Changing your user id to make it compatible with the one that sits on the server

  • If you installed from the standard distribution, your user is is not compatible with the one you have on an other machine, so you have to change it. You can use the user management tool in the System menu (click on "unlock").
  • Create a new group first and use the gid from your server (type id- a on the server machine), e.g. to create a group "stars" with gid 6001:
groupadd -g 6001 stars
  • To change your user id is more tricky, can't do this while you are in the desktop. An easy method is to use the usermod tool (after logging out from the GUI and login in with another user !!), e.g.to change user dks to uid=6000
usermod -u 6001 dks

or if you want to change the uid too:

usermod -g 6000 -u 6001 dks

Firewall

If the mount -a doesn't work there could be a firewall problem. You will have to open NFS communication channels. On the server machine, check the 2049 port.

grep nfs /etc/services

... might tell you what ports nfs needs, e.g.

nfs		2049/tcp			# Network File System
nfs		2049/udp			# Network File System

Now check if these ports are open

sudo ufw status

Change if necessary on the server machine (see below for more details)

ufw allow from your_client_ip to any port 2049 proto udp
ufw allow from your_client_ip to any port 2049 proto tcp
sudo ufw reload
replace your_client_ip by the ip (or domain) of your client machine

Exporting partitions with NFS

Become root, or add "sudo" in front of all commands ...

Either NFS or Samba allow to share a partition with other (client) machines. In order to use NFS:

1) Install NFS on your server machine

apt-get install nfs-kernel-server

2) Configure the directories to be exported by adding them to the /etc/exports file. For example:

/export/data mymachine.yourorg.org(rw,sync,no_subtree_check)

will export the directory /export/data/ for the host (computer) mymachine.yourorg.org with (with-permissions). Do not use something like:

/export/data *(rw,sync,no_root_squash)

I.e. only give specific machines access to your partition and do not let your client machine be root.

2b) If your client machine (e.g. a personal Linux computer) is not in the DNS, then you can either provide an Internet number or define your machine in the /etc/hosts file, e.g.

129.xx.y.z  mymachine

Then in the /etc/exports use something like

 /data mymachine(rw,sync,no_subtree_check)

or

 /data mymachine(rw,sync,no_subtree_check) mylaptop(rw,sync,no_subtree_check)

or

 /web 192.0.2.1(rw,sync,no_subtree_check)

After doing so, type in the shell

exportfs -a

And check:

exportfs

3) Mount the exported directory on your client machines, as already explained above. Firstly make sure that nfs-common is installed.

apt-get install nfs-common 
  • Create an empty directory, e.g.
mkdir /mnt/data
  • Edit file /etc/fstab on your client machine
 servermachine.x.y:/export/data /mnt/data nfs defaults 0 0
  • Then type on your client machine:
 mount -a (on your machine)

If it doesn't work, look at the log files of the server machine. Most likely you failed to give permission. Also, you should restart the NFS daemon on the server. Type:

/etc/init.d/nfs-kernel-server restart

4) User id and group ids

If you want to write files in the server, then user and group id's must match on both machines....

Creating groups

To create an ordinary group of users:

groupadd -g GID_number group_name

e.g.

sudo groupadd  -g 1200 toto

Creating users

  • On your desktop machine, you can use the system menus
    • Unlock (top right) in the user accounts tool, then click on the +.
  • On a server, you can use useradd. Make sure that user and group id's match those of other machines in case you plan to mount partitions (e.g. a web server directory on your desktop).
useradd -ggroup_name -uNNNNN -m -p XXXXX login_name
group_name = name of primary group
NNNNN = uid number, e.g. 160001
XXXXX = password
login_name = login + home directory name, e.g. dks

If you want to add the user to other groups, use the -G flag or use usermod. E.g.

usermod -Gadmin,adm dks
will add the user dks to the adm and the admin group.

A simpler way to make someone admin, is to use the GUI (User Accounts tool in the System tools)

id -a [login]
will display an id of a user

Using Samba


List verbously all users

  • sudo pdbedit -L -v


Add a user (Samba V3)

  • sudo smbpasswd -a sambausername
  • Depending on your setup you also may have to give permission to use shares. Otherwise, we suggest using a kind of group permission in your /etc/samba/smb.conf file, e.g.
[data]
              path = /pics
              comment = Data
              writeable = yes
              valid users = @tourists
              create mask = 0664
              directory mask = 0775

SFTP demon

sudo apt-get install openssh-server

Read: OpenSSH server

Copying files from the old machine

Via scp

An easy way to copy files is to use the scp command which is installed by default.

Exemple - copy recursively a directory from old remote host to the current directory in new (local) machine. On your new, local machine, type something like:
cd ~/some
scp -r username@remote.host:/home/user/some/source_dir/ . 

Via rsync

The rsync program allows to synchronize files between two machines and also can be used to copy and can be recommended to distracted people...

Make sure to include either a trailing slash in the destination folder or go there ! dry-run does what it implies and you should use it first.

Copy to remote (dry run)
sudo rsync --dry-run -azvv -e ssh /home/path/folder2/ remoteuser@remotehost.remotedomain:/home/path/folder2
Get a directory from remote
cd target
rsync -avzh user@remote.host:/home/user/source_dir .
Synchronise Music from remote without displaying (wait for a few minutes or hours)
cd
rsync -azh schneide@129.194.30.22:/home/schneide/Music .

Via Tar and ssh

  • Using tar archives is probably the fastest way, e.g. from the old machine do something like:
(cd /home/path && tar czf - . ) | ssh user@new.machine 'cd /home/path && tar xzf -'

Keyboards

Can misbehave.

In case you got sticky keys: Press the accessibility icon on top menu bar and disable sticky keys. Same for slow keys. (See this)

If key mappings are wrong and you got a logitech keyboard, see below.

For Logitech Devices

Did not work for me. Even the latest 1.18 version did not recognize the Logitech K280e on Ubuntu 22.04 LTS. This wasn't a real problem, since this keyboard works really well.

sudo apt install solaar
solaar

Hower, solaar may not be up-to-date in the official repository and your Logitech device may not be dectected. In that case, you can try downloading a newer version from the repository. For example

sudo add-apt-repository ppa:solaar-unifying/stable
sudo update
sudo apt upgrade solaar

Displays

Principles

Ubuntu 18 easily detects two high resolution monitors (probably under the condition that you did install the third party modules, i.e. an option when you install the system)

Most older Linux distribution's installers (at least the free ones) can't handle some slightly more fancy hardware automatically. Usually you have to do either of two things

  1. Configure the drivers from the ubuntu desktop (if your are lucky) and then use nvidia-settings
  2. Hand edit the /etc/X11/xorg.conf file to tweak things.

Also read:

  • Remember to save every version (preferably on an other machine or in a wiki) that worked.

High resolution monitors for Ubuntu 16.x and sound

I got

  • a DELL Precision T5810 with a Xeon E5-1620
  • a Quadro M4000 graphics card with two monitors
  • a DELL UP3216Q 32 (3840 X 2160) at 60Hz
  • a DELL U2715H 27 (1440 X 2560), i.e. rotated vertically, at 59.95 Hz

The card has four DisplayPort (DP) slots and the (combined) X Screen 0 has 5280x2560 pixels (1397x677 millimeters)

Connecting a high resolution (as of 2017, i.e. 4K) and a half-high resolution monitor does work for both Ubuntu 16 LTS and 18 LTS.

Main trouble when connecting the monitor was that I did not push in the DP connector enough on display side and the system would not detect the monitor. Only after switching the cable I figured it out. Also when you close the "door" at the back of the screen, the DP can become loose again...

Using DP seems to affect sound output, i.e. after connecting a DP monitor sound will be gone ...

  • Either install pavucontrol and use Line Out built-in Audio (the normal Sound controls will not detect this)
  • Or connect the loudspeakers directly to the monitor. In that case they will be detected as HDMI/Display Output in both. The normal "Sound" settings also will see the speaker now (HDMI/DisplayPort/GM204 High Definition Audio Controller). That is the solution I adopted.

Installation of Nvidia Drivers

This is not required usually. Only do it iff you run into trouble.

Some documentation

Firstly, you should know what drivers you have got. In a terminal, type:

 nvidia-smi

The should you see something like the following, i.e. driver version and card model.

Fri Apr 28 18:02:59 2017       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 381.09                 Driver Version: 381.09                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro M4000        Off  | 0000:03:00.0      On |                  N/A |
| 46%   38C    P8    13W / 120W |    179MiB /  8111MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

Alternatively, try

nvidia-settings

If you don't see anything, then there is no driver installed (or you may not have an Nvidia card).

To install or replace a drive, make sure that your machine allows installiong 3rd party drivers.

If you cannot see or use the desktop:

CTRL-ALT F1: To get a terminal

Get rid of old nvidia drivers

sudo apt-get purge nvidia-*

Install the repository (if not already done so)

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update.

Figure out the name of the latest driver. There are several strategies:

  • Google
 sudo ubuntu-drivers devices

Install the latest driver

# sudo apt-get install nvidia-370 // Make sure to take the best driver you need. Best can be the latest, but not necessarily so...
sudo apt install nvidia-381

Adjust to high resolution screen in Ubuntu 16

Setting default fonts of all application is difficult in Ubuntu. You may have to change several settings using several tools. After an upgrade, settings may revert (so keep a note of what you did). Read more here (Adapt Ubuntu to a high-DPI resolution screen)

In Ubuntu 16, you easily can tune the size of menu bars. In the system settings go "Displays" and set the "Scale for menu and title bars", e.g. to 1.38 for a 3840x2160 32 screen and 1.2 for a 2560x1140 27

unity-control-center display

Fixing menu bars will not fix application fonts. You could change "universal access" fonts, but the applications that do respect this (e.g. terminal, thunderbird, ryhthmbox already do adjust font pixels. If you want to try nevertheless, type:

 unity-control-center universal-access 
Seeing --> Large Text; Slide to On

Firefox:

about:config
set layout.css.devPixelsPerPx to a value between 1.2 and 1.5 (I use 1.3 but I got good glasses)

Thunderbird:

  • Fonts are fine on the main screen but too big on the small 27 monitor that has a lower resolution
  • Best solution: Install font-size-changer plugin

Java:

  • Older Java applications are definitely the worst UI experience you can get. Not only you will have to cope with strange panel controls but also you won't be able to read anything. You can try Fix scaling of java-based applications for a high DPI screen who propose a python or a bash script to change resolution.

Adjust to high resolution screen in Ubuntu 18

Install unity tweak tools.

Upgrade the system first !

Installing only the tweak tool did not work ( schema com.canonical.notify-osd no installed). As of July 2018, do the following:

sudo apt-get install notify-osd
sudo apt-get install --reinstall overlay-scrollbar
sudo apt install unity-tweak-tool

The launch it and set Overview -> Fonts, Text scaling factor.

Firefox and Thunderbird: Do as explained in the previous section (Ubuntu 16). That being said, after changing the params in Firefox then ones in Thunderbird did change too. Rather freaky.

Lock Screen

You could set "turn off" and "sceen lock" through the standard GUI tool "Brightness and Lock". However, the max. amount you can input is 60 minutes for both.

to change in terminal to blacken after 1 hour and to lock after 2 hours:

gsettings set org.gnome.desktop.session idle-delay 3600
gsettings set org.gnome.desktop.screensaver lock-delay 7200

Check the settings:

gsettings get org.gnome.desktop.screensaver lock-delay
gsettings get org.gnome.desktop.screensaver idle-delay

Trouble

Cannot not see the desktop

You could try to deinstalling the current driver and replace by a new one. See above.

As of April 2017, you will get strange window decorations, fuzzy around the edges. Workaround: Restart the window manager

compiz --replace

Solution (maybe). Download the latest driver (see above)

sudo apt install nvidia-381

This will ask again to confirm that secure boot is disabled

reboot

... and answer the funny questions

After installing

sudo apt-get autoremove

System cannot wakeup after a longer suspend,

  • the screen remains black, using magic keys like CTL-ALT F4 won't work
  • You may see an "entering Power save mode"
Edit /etc/default/grub
Modify GRUB_CMDLINE_LINUX="" to GRUB_CMDLINE_LINUX="nouveau.modeset=0"
sudo update-grub


You also can try hitting the SHIFT key a lot and then press CTRL-ALT-F1 (log in again)

Configuration

Search System settings, then Displays. Ubuntu should autodetect your monitors. You then can change resolution, rotation and position for each.

For more advanced settings, search CompizConfig in the Dashboard, or type ccsm. You may have to install it and if you have a double monitor configuration, you must install the extras

sudo apt-get install compizconfig-settings-manager compiz-plugins-extra
ccsm &
  • Click on Window Management
  • Tick "Put" (for double monitor)

In addition you could change the hot key for switching.

... Having to install an advanced configuration tool with advanced extras is totally ridiculous. Under Windows adding a second monitor is plug and play. Under Ubuntu this takes 1 hour ore more to figure out.

Ubuntu Nvidia Quadro FX + 2 digital monitors

Recent Ubuntu editions handle Quadro cards quite well (iff and after you managed to install the system, see above). Just use the display tool in the systems settings.

In case you are interested in older versions of Ubuntu, see the wiki history of this article.

Displaying remote programs with X11

According to this Stackexchange, If you are root on another machine and you get " X11 connection rejected because of wrong authentication." try the following (worked for me)

ssh remote_host -XY -luser
sudo su
cd
xauth merge /home/user/.Xauthority

Install fonts

Most fonts one can download are zipped

Install with the font manager

  • extract the files
  • Most fonts are either in TTF (true type font) or OTF (Open Type Font)
  • In the file manager, double click on each file. In Ubuntu 16, fonts will be installed in the ~/.local/share/fonts directory. Since this can take time, see the next item.

Install by copying

  • Put them into the ~/.local/share/fonts directory or the /.fonts directory

Install system wide

apt install fontconfig
  • copy font files to /usr/local/share/fonts
  • sudo fc-cache -f -v

Sounds / Bell / beep

By default, Ubuntu disables the beep in terminals

To get it back (according to this)

  • Run gconf-editor and if the desktop | gnome | peripherals | keyboard | bell_mode setting is present then change it from off to on.
  • Add pactl upload-sample /usr/share/sounds/gnome/default/alerts/glass.ogg bell.ogg to the file ~/.xprofile
  • Add [ "$DISPLAY" ] && xset b 100 to the file ~/.bashrc

To get a bell in Emacs, read AlarmBell

Desktop

Change window control buttons

By default the window control buttons are to the left in Ubuntu 10.04 LTS - the Lucid Lynx - released in April 2010 (annoying for older people like me who don't want to retrain procedures for no good reason).

To fix this, i.e. move the control buttons to the right as before: Press ALT-F2 or open a terminal and type gconf-editor. Navigate to /apps/metacity/general and change the button_layout to :minimize,maximize,close (the : must be in front).

Of course, you also could specify :maximize,minimize,close ....

Hot keys for the brave

So your GUI is stuck ....

To open a console terminal (no GUI), new login

CTRL-ALT F3 to CTRL-ALT F7

Warning: In Ubuntu 16 one could use CTRL-ALT F1 etc. but that does no longer work !!

Then you can for instance restart the Window manager:

sudo restart lightdm

To go back to the desktop (Ubuntu 16)

CTRL-ALT F7

To go back to the desktop (Ubuntu 16)

CTRL-ALT F2

To see boot system messages

CTRL-ALT F8

To restart the X server (your GUI)

CTRL-ALT BACKSPACE

Packages

Basically, an end-user can do most of this stuff with a GUI tool, i.e. the synaptic package administrator. However it is good to know a few command line things for 2 reasons:

  • You may have damaged your desktop when trying to install a new video driver
  • It's sometimes faster. In particular when you see on some website that this and this package should be installed in this and that order ...

A list of command-line stuff (you must be root or add "sudo" in front of each). Sometimes there are equivalent commands for abt-get and aptitude. See the apt howto at Debian.

Installing packages from a package archive

To fix the ubuntu archive mirrors

(if you can, you can also do this from the desktop package manager) Edit /etc/apt/sources.list

You should at least have:

deb http://archive.ubuntu.com/ubuntu/ hardy main universe multiverse restricted
deb http://archive.ubuntu.com/ubuntu/ hardy-updates main universe multiverse restricted

... but the it's better to use a nearby mirror, e.g. for Switzerland:

deb http://mirror.switch.ch/ftp/mirror/ubuntu/  (... same for the rest ...)

To check if there are any partially installed packages. It will try to complete these installations.

 dpkg --configure -a

To find a package XXX

 aptitude search XXX
Installing
apt-get install XXX

If this fails because of dependency issues, you then can try:

apt-get -f install
Cleaning and such

To detect and fix dependency problems

 aptitude -f install

To remove packages from the local cache

 apt-get clean

To update the package list

 aptitude update

To reinstall a package XXX that seems to be broken

 apt-get --reinstall install XXX
Upgrading

To upgrade conservatively

 aptitude safe-upgrade

To upgrade with a an message showing packages

 apt-get -u upgrade

To upgrade to a new release

 apt-get -u dist-upgrade
Removing

To really remove package XXXX

 apt-get --purge remove XXXX

If a package doesn't want to go (e.g. something went wrong during install, e.g. a decompression error and a crash in the middle of the install) and an installer (or you) wants it go, look for the package in /var/lib/dpkg/status and make it install ok installed Followed by:

 apt-get remove --purge XXXX
 apt-get update
 apt-get dist-upgrade (or whatever you planned to install)

Installing deb files

Sometimes, software is distributed as package for download, i.e. a *.deb file

To install it:

 dpkg -i XXX.deb

If you run into dependency error messages you'll have to add packages (no problem) or remove packages (avoid !).

Example (for the eXe eLearning authoring system):

 dpkg -i python2.5-exe_1.04.0.3532-ubuntu1_i386.deb

will give:

 Unpacking python2.5-exe (from python2.5-exe_1.04.0.3532-ubuntu1_i386.deb) ...
 dpkg: dependency problems prevent configuration of python2.5-exe:
 python2.5-exe depends on python-zopeinterface (>= 3.0.0-6); however:
 Package python-zopeinterface is not installed.
 dpkg: error processing python2.5-exe (--install):
 dependency problems - leaving unconfigured

First thing to do is to try something like:

 apt-get install python-zopeinterface

Information about packages

xxx is the package name or package file (*.deb) name

Getting information about a package
apt-cache search xxx
apt-cache showpkg xxx
apt-cache show xxx
To find a package on your system, if you know a file name
dpkg -S xxx_file_name

or

apt-file search filename
To list all packages and search for a name.
dpkg -l | grep xxx
To extract a deb file without really installing it
dpkg --unpack xxx.deb
To list the contents of a package file
dpkg -c xxx.deb

Holding packages

In theory:

apt-make hold packagename

However, this doesn't seem to work as expected, i.e. Ubuntu will try to update dependencies of a package that you not want to upgrade. For exemple if your package uses and old Java, it will try to update it, although it is gone from the repository.

Edit file /var/lib/dpkg/status

  • Remove unwanted old packages from Dependencies:

Boot files

Identify the kernel you currently use:

uname -r

List all installed images:

 dpkg -l linux-image-\* | grep ^ii

If the following does not work (e.g. because the file partition is full):

sudo apt-get purge linux-image-3.2.0-55

try:

sudo dpkg --purge linux-image-3.2.0-55-generic
... etc.

Then, in order to complete a previous failed installation:

sudo apt-get -f install

Finally, now clean a whole lot of other old ones, eg.

sudo apt-get purge linux-image-3.2.0-58 linux-image-3.2.0-59 linux-image-3.2.0-60 linux-image-3.2.0-61

And remove other stuff you don't need

sudo apt-get autoremove

Other types of software packages

There exist several other distribution mechanisms, such as flatpack or appimages

Appimages

App images contain all the libraries needed to run an application. It therefore should run on most Linux systems.

To use:

  • Download
  • Change permission to +x
  • Run it

For better integration, read this. In short, install AppImageLauncher. If you click on an appimage in the filemanager, it will copy it to a specific directory and integrate it in the system, e.g. you can dock the application later.

sudo add-apt-repository ppa:appimagelauncher-team/stable
sudo apt update
sudo apt install appimagelauncher

This only will work with clean appimages. Those that are broken and need extra paramters do no seem to work. E.g. mendeley needs an extra --no-sandbox parameter.

./mendeley-reference-manager-2.84.0-beta.0-x86_64_cb2cce94615522bfd12079b8bad4cd8b.AppImage --no-sandbox &


Printers

Printers don't necessarily work automatically either:

Before connecting a network printer, it is likely that you need a a PPD file (a file that defines properties of your postscript printer). Get it from:

Example Infotec

(this needs to be verified)

Example for Infotec ISC 1032 (A low end color copy and printer machine)

Different Ubuntu user name ?

Read Use different username on CUPS remote printing

Summary (Quoted from above) According to the man page https://www.cups.org/doc/man-client.conf.html, a User directive could be placed in /etc/cups/client.conf or ~/.cups/client.conf

However, this didn't work for me in Kubuntu Trusty. What worked, was to export the CUPS_USER environment variable by adding the following line in ~/.profile:

export CUPS_USER=vangelis

X Windows

We run a few sun servers and I prefer to run emacs (GUI) on a remote machine instead of mounting all these file systems. Also I prefer to have a root terminal open instead of typing 'sudo' all the time. If you want allow for this:

Reconfigure the window manager (gdm)
  • Edit /etc/gdm/gdm.conf and change:

DisallowTCP=true

  • Then, you'll need to restart your X session (Ctrl + Alt + Backspace)
Allow remote hosts to connect
  • Then you can allow certain hosts to connect e.g. to allow root on your own machine type
xhost + localhost
  • To allow somebody on a different machine, type:
xhost + xxx.yyy.zzz
  • It's important not to to type 'xhost +'. Since anyone may then connect to your screen. However, type xhost + something is boring, so it's more practical to edit /etc/X0.hosts. Just put the names or IP numbers of authorized machines there.
If it doesn't work

You can install nmap to scan ports (X is on 6000).

  • If you don't have nmap:
sudo apt-get install nmap
  • Then type (as user):
nmap -v -A localhost

In some cases you may have to define the display of your machine on your client machine. On your client machine type something like:

export DISPLAY=xxx.yyy.zzz:0

or

setenv DISPLAY xxx.yyy.zzz:0

Or more practical, log into the the client machine like this:

ssh -XY

Java

By default Ubuntu comes with some Java compatible version that is free. For some applications though, you need Java 7 or 8 from Oracle (Java formerly was made by Sun)

Java 11

(tested with Ubuntu 18 LTS)

There are several repositories from which you can get an installer. Alternatively, you could Java from Oracle and install it manually.

Read this:

 sudo apt update
 sudo apt upgrade

.....

Java 8

(tested with Ubuntu 14.x LTS)

Read this:

Install it:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Test it:

java -version

You should see something like

java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

Managing several version

Several java version can be managed through script, but at the system level there is a simpler solution

sudo update-alternatives --config java

Java in Firefox

Installing Java does not install a plugin in Firefox. Java is needed for many institutional applications and in addition there are many interesting applets for education. So let's go. Make sure that Java is installed on your machine (e.g. see above for Oracle Java).

For old Firefox version

The following will not work with a recent Firefox )> 53 I believe)

Install a a Firefox plugin that should enable a currently installed Open Java (did not work for me)

sudo apt-get install icedtea-plugin

Create a symbolic link to the Oracle plugin from the Firefox plugin directory (did not work for me)

cd /usr/lib/firefox-addons/plugins
ln -s /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libnpjp2.so

Install the Firefox ESR version (this works)

It seems that the only way to have Java under Linux is to install an old version of Firefox. The "ESR" version was made for just this purpose.

* Download firefox ESR
* Unpack the bz file somwhere, e.g. in  ~/bin/firefox
tar xjvf firefox-52.2.0esr.tar.bz2
mv firefox ~/bin/

Then launch it like so:

~/bin/firefox/firefox --new-instance -P ESR
this is important I believe. You should not mess with your default profile that you use with your regular new version of firefox. This version is just for messing with Java applets.

Sound and music

Since Ubuntu 16LTS, sound works rather well. The only problem is figure out how to hook up the external speakers (see the display section for that)

Music services

Music services through the browser may not work (google for solution).

E.g. to use Amazon cloud music, read this

Nuvola is available through flatpak, a kind of app distributor that works across various OSs.

sudo apt-get install flatpak xdg-desktop-portal-gtk gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists nuvola https://dl.tiliado.eu/flatpak/nuvola.flatpakrepo
flatpak update
flatpak install nuvola eu.tiliado.Nuvola

The launch flatpak and find the nuvola amazon cloud player. Click on install.

This worked for me (Ubuntu 18, using Amazon France from my workplace in Switzerland). Listening to Lazy Bird from John Coltrane while writing this.

Crackling sound in Ubuntu 18

After installing Ubuntu 18 it became impossible to listen to Music. Something that pulseaudio does seems to be the reason.

killall pulseaudio

Caveat: Needs to be repeated each time you reboot.

The next solution also seems to work (various forums give this solution)

1) Edit file

/etc/pulse/default.pa

2) Change line

 load-module module-udev-detect 

to

load-module module-udev-detect tsched=0

3) Then restart

pulseaudio -k
pulseaudio --start

Notice: Removing pulseaudio from the system does not seem to be a great idea.

Tips of older Ubuntus

In older Ubuntu distributions (e.g. LTS 12) sound may not work either.

  • Install all the ALSA stuff (e.g. via the synaptic package manager)
  • Then test with Menu System->Preferences-Sound
  • Then set the right default volume with Menu Applications->Sound and Video->ALSA Mixer GUID (in particular PCM ! It may be as simple as that ...)

If sound doesn't work search the Ubuntu forums: http://ubuntuforums.org/. A particular good overview posting was:

To list you sound hardware, type:

  aplay -l

If there are none, type:

  lspci -v

... and search through the list until you find something like:

 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)

This means that you do have a sound card, but that the drivers or something else is missing....

Anyhow it may take some time (between a few minutes and a few days) to find a solution. Often, the only thing you'd have to do is to add a line to /etc/modprobe.d/alsa-base (needs root permissions). I have for my DELL/Sigmatel:

 options snd-hda-intel model=ref

Then, reboot !

Note: To list all drivers on your machine, type:

lsmod

If I understand right, drivers are kernel modules.

Give permission to insecure web sites

Nearly no Java Web site will run once you enabled Java.

Give these sites permission (of course, only do that with your local administration or non-local friendly educational applications...)

jcontrol &
Security tab.

Application hints

Rhythmbox

To edit a playlist (i.e. reorder items), there are two options

  • You can drag items up and down (untick "browse" in the View menu, if you need more space)
  • You can edit the XML (better for very large lists, maybe do a save before you do this)
.local/share/rhythmbox/playlists.xml

Also, it's a good idea to remember that you can copy this file, if you decide to re-install your machine and start with a clean/new setup

Who else has Linux nearby ?

sudo nmap -O xxx.yyy.zzz.1-255 | grep "Running: " | sort | uniq -c

Non-standard software

Some organization maintain their own Debian/Ubuntu package servers.

Dropbox

Works quite well on Ubuntu 22

If it does not, try man dropbox, e.g.

dropbox status
dropbox start
dropbox update

Screenshots

Most people did agree that Shutter was the best tool

 sudo apt install shutter
Shots can be edited and annotated with a built-in editor.
To install as default, read this, Before you can assign the PrtScreen button, you must reset the existing shortcut using backspace.
Tip: Double click when using selection.

Since Ubuntu 18, there is also Flameshot, but unless I missed something it cannot do text.

 sudo apt install flameshot
to launch it, type
 flameshot gui
The edit will directly appear in the shot.

Neither is as good as Greenshot for Windows IMHO, but both are OK. Since Flameshot is new, it might have bugs (I do not know)

Shotcut

Shotcut is a cross platform free video editor which has good rankings (also on Windows). Tested on oct. 2017 with Ubuntu 16x.

There are different ways to install it. I chose a PPA distribution that seems to be trustworthy. I also had to add a missing library after installing.

sudo add-apt-repository ppa:haraldhv/shotcut
sudo apt-get update
sudo apt install shotcut

First time, launch it in the terminal so you can spot errors if there are.

shotcut

Install this one before if you do not have it.

sudo apt-get install libsdl2-2.0

Mendeley

Mendeley, the bibliography and article manager does have a Debian distribution.

Read Download Mendeley Desktop for Ubuntu.

  • Click on the download link
  • Install from the package manager that should open

Run it:

mendeleydesktop &

Also, install the libre office and web browser plugins if not already done so.

Skype

E.g. to install Skype, you could

  • Add the Skype repository like this in the Synaptic Package Manager (through settings->Repositories->Third-Party Software)

deb http://download.skype.com/linux/repos/debian/ stable non-free

  • Reload or update the package information and search for "skype"
  • Install the skype package.

Google Chrome

Read How to install Google Chrome (askubuntu)

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable

Security

SSH Keys
Firewall

Show

sudo ufw status
sudo ufw --help

To allow port 7777 for tcp for everyone:

sudo ufw allow 7777/tcp

To allow port 2049 for TCP and UDP for a given IP (replace your_ip_number with your IP number)

sudo ufw allow from your_ip_number to any port 2049 proto tcp 
sudo ufw allow from your_ip_number to any port 2049 proto udp 

To allow everything from a given IP

sudo ufw allow from ip_number_here

After that, reload the firewall:

sudo ufw reload

To disable / enable

sudo ufw disable
E.g. for testing purposes ....
sudo ufw enable

Opinions and alternatives

Add yours ...

DKS

  • Daniel K. Schneider uses Ubuntu since March 2007, because he got fed up with Mandriva updates not working correctly. I hate all OS's (Unix, Mac, Win) but prefer to work on Unix because it's fairly stable and appropriate for what I do. I also do have Windows machines for doing stuff that needs Win 7. (E.g. Flash, word processing with Framemaker, X3D, Games). Our servers (e.g. for this wiki) run mostly under Ubuntu too. Before we ran Solaris which is much more difficult to install and maintain but extra solid.
  • Indeed (it's now August 2007 and I went through a major upgrade) I find that Ubuntu and its packaging system is far more robust. Though I once failed with a non supported package, i.e. Cinelerra that I got from another site. It installed, but crashed on start. Have to try again at some point.
  • If your applications crash (e.g. Firefox) check your bloody RAM. It may be defective and you can loose 3 days of work trying to reinstall when there is absolutely no need. Ubuntu is solid, even if the installation can be messy !
  • I don't like the new 12.04 Desktop. Not very efficient for people who know what they are doing (see the installation notes on top)

Alternatives

  • Linux Mint, can be described as some kind of easier to use Ubuntu. There is also a Linux Mint Debian Edition that is directly based on Debian and it may be of interest to people who want to be closer to Debian. Both editions should behave in the same way. Read the Wikipedia article and Linux Mint 15 A better Ubuntu for the desktop (May 2013).
sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update 
sudo apt-get install cinnamon

Then, log out and you will have the option to use Cinnamon. The normal Ubuntu Desktop will remain there and you can therefore switch back easily....

Links

(there are many others)

Official
Other