Installing Kubuntu 22.04

From Applied Optics Wiki
Jump to: navigation, search

Hopefully is a fully robust installation for Kubuntu 22.04. Minor things such as: "press X button to access bios/boot menu" are left out. Some of these instructions are ported over from the Installing Kubuntu 16.04 page.

Pre-installation checklist

- List of installed software by you and others who use the PC (skip if new PC)

- Back up locally (not on network drives) stored files (skip if new PC)

- Have access to bios setup/boot menu - very relevant for new PCs. If locked, contact university information service (IS) to come and unlock it, or better still, request it before placing PC order.

Installation screens

I. Boot setup

Interrupt the normal booting procedure for the computer. The means for doing this will be displayed on the screen with the maker of the CPU, e.g. Lenovo. For Lenovo press 'Enter' otherwise it might be F2, Del, etc. Enter the BIOS Setup Utility menu, e.g. by pressing F1 on Lenovo, and arrow to the Startup sub-menu. Enter into the Primary Boot Sequence; 'shift +' the USB drive to the top of the queue. Save and exit (e.g. F10).

II. Install menu

After a bit of a load time on the Kubuntu splash screen, select install Kubuntu (this screen may be bypassed by the installer)

1. Welcome

Select language 'English' and click on 'Install Kubuntu'

2. Preparing to install kubuntu

[May show drive space availability (tick) and internet connection (cross)] Tick 'install this third-party software...' Click 'continue' (bottom right)

3. Installation type

Select manual and continue.

4. Prepare partitions

You may have Windows pre-installed and want to keep it. It will most likely show up as device:/dev/sda1 type:ntfs. If this isn't partitioned (determined with HDD bar at top showing 100% Windows) and you want to keep windows, seek help! Otherwise you can delete this partition.

If you kept the Windows partition, mount the partition by selecting it, clicking 'change...';

- windows: keep the same partition size, use as 'NTFS' (or whatever the type showed up as earlier), DO NOT tick format, and set mount point as '/windows/C/'. Click 'ok'. If there are two ntfs allocations designate the larger of the two as the mount point '/windows/C/' and the smaller of the two as the drop-down option '/windows' without ticking format for each.

The other partition/s will need to be split into three. Select the 'free space' partition and click 'add';

- EFI: designate 1 GB as an 'EFI' type, click 'ok'

- root: select 'primary', size is '40960MB' (adjust for small HDD), location is 'beginning', use as 'Ext4 jfs', mount point is '/', click 'ok' (it will automatically format)

- eee: size is the rest of available disk space (default), location is 'beginning', use as 'Ext4 jfs', mount point is '/eee', click 'ok' (will auto format). Next it is important to correctly select your boot loader location, this will be the entire partition where root is located, e.g. '/dev/sda' or '/dev/sdb' (usually). Also recheck that windows format box is not ticked, it will be a hassle to get it back. Click on 'install now' in the bottom right.

5. Where are you?

Region is 'Europe', Time zone is 'United Kingdom time', click continue.

6. Keyboard Layout

Layout is 'English (UK)', Variant is 'English (UK)' (unless its different), click continue.

7. Who are you?

Your name is your computer `compname` (it is assigned and should be known; ask someone!), username is `compname_local`, password (also should be known) is `comppassword`, your computer's name is `compname` .

(go and get some tea or shut-eye)

8. Installation complete

Take out the Kubuntu USB-stick, click restart.

Post install

Upon restarting, do as before and interrupt the boot such that you can reach the Primary Boot Sequence in BIOS Setup Utility -> Startup. Here alter the boot sequence again so that the disk Kubuntu is partioned onto, boots first. If this partition was second chronologically in your partitions window, then in the boot menu it should be the name of your hard drive with the number 2 (e.g. Scan2 not Scan1, or whatever the name of the drive is). Double check your partitions/make sure you have the correct boat loader location if Kubuntu cannot boot correctly after installing it from the USB and changing the boot sequence.

- After the splash screen, login using the details you provided during setup.

Getting access to root

Open Terminal/Konsole through the Application Launcher (start button) or by right clicking anywhere, click 'add panel' -> 'default panel'. In terminal, enter;

sudo passwd root

enter the `comppassword` x3.

Setting your IP address

Unlike previous versions, the network manager can be configured fairly easily in 22, e.g. using 'nmtui'

- In the terminal enter nmtui, then press enter for 'Edit a connection', use the right arrow to locate/enter the <Edit...> sub-menu for the 'Wired connection 1' that should be selected already.

- Arrow down to the 'IPv4 CONFIGURATION' row and arrow over to <Show> and press Enter

- Arrow to <Add> and press enter for each of the below entries:

Addresses 128.243.74.xxx replace 'xxx' with your own IP

Gateway 128.243.74.254

DNS servers 128.243.40.11 128.243.40.12 128.243.21.19 (<Add> for each address individually)

- Arrow down to <OK> and press enter. Arrow down to <Back> and enter, then arrow down to <Quit> and enter.

Downloading upgrades/needed programs

- Open 'muon package manager' (e.g. in start menu or 'sudo muon' in terminal).

- Click 'check for updates', wait..., click 'full upgrade' and 'apply changes'.

(go for another nap)

- Restart, login as root and re-open 'muon'.

- Search and install; 'nfs-common', 'autofs', 'nis', and 'nfs-kernel-server'. Click 'apply changes'.

- 'nfs-kernel-server' used to prompt to set the domainname, however, no longer seems to do that. Instead set it manually, e.g. as below:

sudo nano /etc/defaultdomain (or whichever terminal editor you prefer beyond nano)

applied_optics (populate the file with this and save/exit)

- Restart and login as root.

Access to shared directories

- Add to /etc/yp.conf

domain applied_optics server 128.243.74.2

ypserver 128.243.74.2

- Edit /etc/nsswitch.conf and add/amend/check the protocols list to ensure that the following designations exist in the file (and leave all others untouched):

passwd: compat nis

group: compat nis

shadow: compat

hosts: files nis dns

networks: files dns

protocols: files

services: files nis

ethers: files

rpc: files

netmasks: files

netgroup: nis

publickey: files

bootparams: files

automount: nis files

aliases: files nis

- Ensure that /etc/host.conf possesses the code

order hosts, bind

multi on

- (Optional) Move /home to /local_home and create another /home directory with full access;

mv /home /local_home

mkdir /home

chmod 777 /home

- Edit /etc/passwd by adding '+::::::' to the end of the file.

- Edit /etc/group and add '+:::' to the end.

- Run below in terminal

systemctl restart rpcbind nscd ypbind autofs rpcbind

systemctl enable rpcbind nscd ypbind autofs rpcbind

- Restart, you should now be able to login under your own user name and see all users files in /home. If not ask for help.

Sudo

After this step, you shouldn't need to use the root password, but your linux password. Add to /etc/sudoers under the #Members... section

%scan ALL=(root) ALL

More bits

aptitude full-upgrade

sudo apt-get install tcsh openssh-client openssh-server tmux

Fail2Ban

DTS require us to have fail2ban installed on all our linux machines - MAKE SURE YOU INSTALL THIS!

sudo apt install fail2ban

sudo systemctl enable fail2ban --now

Firefox Shenanigans (from Matt)

By default the latest version of firefox is installed as a "snap" package rather than a "deb". This is extraordinarily dumb and you do not want it. If you install the latest kubuntu then I strongly advise you follow these instructions (below) from:

https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04

-This will undo this stupidity. You won't lose your browser history / passwords / etc etc and firefox should continue to work across machines as you expect.

-Also this fix needs to be done once per new machine - the profile fix needs to be done everytime a user logs into the new machine for the first time.

-the snap runs in a container and cannot see your profile, it can import your profile as I mentioned before but then it won't be accessible from another machine and you'll end up with two unconnected ones. Plus it is <really> slow and disconnected from the usual helper programmes which is a PITA

Instructions:

(1) remove the snap sudo snap remove firefox

(2) connect to the source of firefox as deb sudo add-apt-repository ppa:mozillateam/ppa

(3) prioritise the deb over the snap (cut and paste into terminal from kate or something):

echo '

Package: *

Pin: release o=LP-PPA-mozillateam

Pin-Priority: 1001

' | sudo tee /etc/apt/preferences.d/mozilla-firefox

(4) prevent auto updates reverting your good work (same as above):

echo 'Unattended-Upgrade::Allowed-Origins::

"LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox

(5) install firefox the right way sudo apt install firefox


Matts method didn't work for me, i followed the instructions here: https://fostips.com/ubuntu-21-10-two-firefox-remove-snap/ this got firefox installed by apt ok

Installing Teams

- E.g. download from https://www.microsoft.com/en-us/microsoft-teams/download-app#allDevicesSection

- 'cd' to Downloads or wherever the .deb as gone, ensure it is executable: sudo dpkg -i teams_XX.deb (where 'XX' is the rest of the .deb filename)

- If you get dependency errors then: sudo apt --fix-broken install and repeat above


Microsoft doesnt support linux at the moment so use teams-for-linux


sudo mkdir -p /etc/apt/keyrings

sudo wget -qO /etc/apt/keyrings/teams-for-linux.asc https://repo.teamsforlinux.de/teams-for-linux.asc

echo "deb [signed-by=/etc/apt/keyrings/teams-for-linux.asc arch=$(dpkg --print-architecture)] https://repo.teamsforlinux.de/debian/ stable main" | sudo tee /etc/apt/sources.list.d/teams-for-linux-packages.list

sudo apt update

sudo apt install teams-for-linux

Installing Matlab

use mathworks account based on Uni email to log in download linux zip for the version you want.

At the system terminal do not use dolphin to do this as it breaks everything, unzip the matlab_R2023b_glnxa64.zip installer archive to the matlab_R2023b_glnxa64 directory by entering: unzip matlab_R2023b_glnxa64.zip -d matlab_R2023b_glnxa64

The installer fails to launch as root, as it doesn't have access to the graphical user interface that you need for installation. so do:

xhost +SI:localuser:root

sudo -H ./install

When prompted by the installer, specify the folder for installation. this should be in /eee/MATLAB/R20XYa (what ever the release is)

xhost -SI:localuser:root This allows the root user to access the running X server, launches the installer, and then removes the root user from accessing the X server.

Printers

The install script and drivers are in /home/share/printers/

run on local machine to install



Finish

The installation of Kubuntu 22.04 and all the useful softwares should be done at this point beyond those which require manual installs such as MATLAB. Ask for help if you find any problems.