Difference between revisions of "Installing Debian 12.9.0"

From Applied Optics Wiki
Jump to: navigation, search
(Installation screens)
 
(48 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
Hopefully is a fully robust installation for Debian 12.9.0.
 
  
 
==Pre-installation checklist==
 
==Pre-installation checklist==
  
- List of installed software by you and others who use the PC (skip if new PC)
+
* Download [https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.9.0-amd64-netinst.iso debian-12.9.0-amd64-netinst.iso] - if this link is broken find another one! Mount as boot iso on a USB stick, e.g. you can use RUFUS on windows to do this or dd on linux. Skip if someone has provided a pre-configured stick to you.
 
+
* List of installed software by you and others who use the PC and backup locally (i.e. on USB drives and not on network drives) - skip if new PC
- Back up locally (not on network drives) stored files (skip if new PC)
+
* Make note of your <code>IP address</code> and <code>hostname</code> (this is the same as your ''computer name'') - talk to Rikesh or Matt if new PC
 
+
* '''IMPORTANT''': Print two labels - one with your <code>IP address</code> and one with your <code>hostname</code> - stick it on the front+top of your PC so that it is clearly visible to all users
- 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.
+
* Make sure the PC is plugged into the wall (specifically in L4)
 +
* If you are not be able to see the option to enter the bootup menu - find the oldest monitor you can and connect the PC to it
  
 
==Installation screens==
 
==Installation screens==
Line 14: Line 13:
 
'''I. Boot setup'''
 
'''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).
+
* Interrupt the normal booting procedure for the computer - common keys for entering BIOS or boot menu are ''Enter/F1/F2/F11/F12/Del''. If on a Lenovo PC press ''Enter'' when the Lenovo boot splash screen turns up, enter the BIOS Setup Utility menu by pressing ''F1'' and arrow to the Startup sub-menu.  
 +
*Enter into the Primary Boot Sequence. Change boot order from BIOS to boot from [USB HDD] or [USB CD-ROM] ('''very''' relevant for new PCs - talk to Rikesh or Matt) depending on what turns up by pressing ''+'' on the USB drive to the top of the queue.
 +
* Save and exit with ''F10''.
 +
* If you cannot see the boot or setup menu, you may need to plug your screen into the GPU output rather than the motherboard output (or vice versa).
  
If you cannot see the boot or setup menu you may need to plug your screen into the GPU output rather than the motherboard output (or vice versa).
 
  
 
'''II. Install menu'''
 
'''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)
+
* The Debian splash screen should show up, select install ''Graphical install''
  
'''1. Welcome'''
+
'''1. Language'''
  
Select language 'English' and click on 'Install Kubuntu'
+
* Select language ''English'', ''United Kingdom'', and ''British English'' - it will now do an initial harware/network configuration (1min)
 +
* The USB may fail as the installer thinks the drive is CD drive - if this happens try moving the USB drive to a port on the back of the PC
  
'''2. Preparing to install kubuntu'''
+
'''2. Configure network'''
  
[May show drive space availability (tick) and internet connection (cross)] Tick 'install this third-party software...' Click 'continue' (bottom right)
+
* The network autoconfiguration will fail - this is fine. Continue and select ''Configure network manually''
 +
* Enter your PC's IP address (see earlier)
  
'''3. Installation type'''
+
* Enter <code>255.255.255.0</code> for the netmask
 +
* Enter <code>128.243.74.254</code> for the gateway
 +
* Enter <code>128.243.21.19</code> for the nameservers (DNS)
 +
* Enter your ''computer name'' as the hostname (this may be filled in for you already!)
 +
* Enter <code>applied_optics</code> as the domain name
 +
* '''Do not set a root password''' - just leave blank and click continue
 +
* Enter <code>local_[hostname]</code> for the user's name and username
 +
* You should already been advised what the user <code>password</code> should be, if not ask!
 +
* The install will then start looking for disks
  
Select manual and continue.
+
'''3. Formatting Disks'''
  
'''4. Prepare partitions'''
+
* Warning this will wipe Windows!
 +
* For partitioning select ''Manual''
 +
* Double-click your primary hard drive which should firstly be an NVMe drive (e.g. /dev/nvme01)
 +
* Select 'Yes' for wiping and do the same for any other hard drives you want to wipe - make sure you '''DO NOT''' wipe your USB drive
 +
* Select the ''FREE SPACE'' partition under your first hard drive and create a new partition ''by'' selecting the ''Automatically partition the free space'' option - this creates sensible partitions but if you require something more specialist you should already know how to set this up
 +
* Select ''All files in one partiion'' - you should end up with a bootable partition in #1 (~500MB), your root <code>/</code> directory in #2, and swap in #3 (~1.0GB),
 +
* Partition your second/additional hard drives to wherever you want/need to (i.e. <code>/eee</code>) - this time select 'Create a new partition' - set the partition size to 'max' - to change the mount point enter manually <code>/eee</code>, click on ''Done setting up' and click on ''Finish partitioning and write changes to disk'' - select ''Yes'' to write changes to disks,
 +
* The installation will begin. (2mins)
  
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.
+
'''4. Complete installation'''
  
If you kept the Windows partition, mount the partition by selecting it, clicking 'change...';
+
* To configure the package manager, select ''United Kingdom'', select the top option for the software repository (e.g. <code>deb.debian.org</code>), and leave the proxy entry blank
 +
* Software and updates will start installing (1min)
 +
* For software popularity context select ''No'',
 +
* Unselect ''Debian desktop environment'' and ''GNOME Flashback'' - select ''KDE Plasma'' and ''SSH server''
 +
* Leave 'Standard system utilities' selected
 +
* It will then continue installing (5mins)
 +
* Click continue to reboot (you can pull out the USB drive after it has restarted)
  
- 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.
+
==Nvidia drivers==
  
The other partition/s will need to be split into three. Select the 'free space' partition and click 'add';
+
You might notice that once you log in (using <code>local_[hostname]</code> and <code>password</code> from earlier, the framerate will tank - this is because the default <code>nouveau</code> drivers does not work well with your Nvidia card and newer Wayland display protocol. You have two options:
  
- EFI: designate 1 GB as an 'EFI' type, click 'ok'
+
1. Before login, change the ''Desktop Session'' in bottom left to Plasma (X11) (not recommended for long term)
  
- 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)
+
2. Install Nvidia drivers - follow the steps below for this:
  
- 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.
+
* Firstly you must turn off ''Secure boot'' in the bios (restart and enter bios...) under 'Security' change 'Secure Boot' to disabled and hit F10 --- or enrol your system key [https://wiki.debian.org/SecureBoot#DKMS_and_secure_boot] (bios should be option 1, not enrol!) - if you do not, you will get a 'Failed to start Nvidia persistence daemon' error at startup
 +
* Enter the commands below to install the drivers (you should be able to access this wiki page from your new PC to copy into Terminal):
 +
<pre>
 +
sudo apt update
 +
sudo apt upgrade
 +
sudo apt install software-properties-common -y
 +
sudo add-apt-repository main contrib non-free non-free-firmware
 +
sudo apt update
 +
sudo apt upgrade
 +
sudo apt install linux-headers-amd64 nvidia-kernel-dkms -y
 +
</pre>
  
'''5. Where are you?'''
+
* The install will complain about nouveau, click ok to replace - continue with the following commands:
  
Region is 'Europe', Time zone is 'United Kingdom time', click continue.
+
<pre>
 +
echo 'options nvidia-drm modeset=1' | sudo tee -a /etc/modprobe.d/nvidia-options.conf > /dev/null
 +
echo 'options nvidia NVreg_PreserveVideoMemoryAllocations=1' | sudo tee -a /etc/modprobe.d/nvidia-options.conf > /dev/null
 +
sudo reboot
 +
</pre>
  
'''6. Keyboard Layout'''
+
* You should now be able to use the default ''Wayland'' protocol for the display
  
Layout is 'English (UK)', Variant is 'English (UK)' (unless its different), click continue.
+
==Getting on the OPG network==
  
'''7. Who are you?'''
+
<pre>
 
+
sudo apt update
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''` .
+
sudo apt upgrade
 
+
sudo apt install nfs-common autofs nis nfs-kernel-server -y
(go and get some tea or shut-eye)
+
echo 'applied_optics' | sudo tee -a /etc/defaultdomain > /dev/null
 
+
echo 'domain applied_optics server 128.243.74.2' | sudo tee -a /etc/yp.conf > /dev/null
'''8. Installation complete'''
+
echo 'ypserver 128.243.74.2' | sudo tee -a /etc/yp.conf > /dev/null
 
+
sudo sed -i 's/passwd: /passwd: compat nis /g' /etc/nsswitch.conf
Take out the Kubuntu USB-stick, click restart.
+
sudo sed -i 's/group: /group: compat nis /g' /etc/nsswitch.conf
 
+
sudo sed -i 's/shadow: /shadow: compat /g' /etc/nsswitch.conf
==Post install==
+
sudo sed -i 's/hosts: /hosts: nis /g' /etc/nsswitch.conf
 
+
sudo sed -i 's/networks: /networks: nis dns /g' /etc/nsswitch.conf
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.
+
sudo sed -i 's/services: /services: nis /g' /etc/nsswitch.conf
 
+
echo 'automount: nis files' | sudo tee -a /etc/nsswitch.conf > /dev/null
- After the splash screen, login using the details you provided during setup.
+
echo 'aliases: nis files' | sudo tee -a /etc/nsswitch.conf > /dev/null
 
+
echo 'order hosts, bind' | sudo tee -a /etc/host.conf  > /dev/null
===Getting access to root===
+
echo '+::::::' | sudo tee -a /etc/passwd  > /dev/null
Open Terminal/Konsole through the Application Launcher (start button) or by right clicking anywhere, click 'add panel' -> 'default panel'. In terminal, enter;
+
echo '+:::' | sudo tee -a /etc/group  > /dev/null
 
+
sudo sed -i '/^# Allow members /a\%scan ALL=(root) ALL' /etc/sudoers
<code>sudo passwd root</code>
+
sudo rm -R /home
 
+
sudo mkdir /home
enter the `''comppassword''` x3.  
+
sudo chmod 777 /home
 
+
sudo systemctl enable rpcbind --now
===Setting your IP address===
+
sudo systemctl enable nscd --now
 
+
sudo systemctl enable ypbind --now
Unlike previous versions, the network manager can be configured fairly easily in 22, e.g. using 'nmtui'
+
sudo systemctl enable autofs --now
 
+
</pre>
- In the terminal enter <code>nmtui</code>, 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:
 
 
 
<code>Addresses 128.243.74.xxx</code> replace 'xxx' with your own IP
 
 
 
<code>Gateway 128.243.74.254</code>
 
 
 
<code>DNS servers 128.243.21.19</code>
 
 
 
(DNS serves 128.243.40.11, 128.243.40.12 have been removed by DTS -RP)
 
 
 
- Arrow down to <OK> and press enter. Arrow down to <Back> and enter, then arrow down to <Quit> and enter.
 
 
 
(Try setting the netmask to <code>255.255.255.255</code> and disconnecting/connecting if the above doesn't work -RP)
 
 
 
===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:
 
 
 
<code>sudo nano /etc/defaultdomain</code> (or whichever terminal editor you prefer beyond nano)
 
 
 
<code>applied_optics</code> (populate the file with this and save/exit)
 
 
 
- Restart and login as root.
 
  
===Access to shared directories===
+
* Reboot manually and login as yourself
 +
* '''Contact Rikesh''' to let him if you have successfully logged in (and confirm network access on the server side) or if you have failed
  
- Add to /etc/yp.conf
+
==Clean up and additional software==
  
<code>domain applied_optics server 128.243.74.2</code>
+
* '''REQUIRED:''' Run the following for clean :
  
<code>ypserver 128.243.74.2</code>
+
<pre>
 +
sudo userdel -r local_[hostname]
 +
sudo apt install fail2ban -y
 +
sudo systemctl enable fail2ban --now
 +
sudo systemctl restart fail2ban
 +
</pre>
  
- 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):
+
* '''Semi-optional''': Install some other useful software that may come in handy in the future..
  
<code>passwd:        compat nis</code>
+
<pre>
 +
sudo apt install tcsh tmux ksh cmake git libgtk-3-dev libgtk2.0-dev default-jdk remmina xrdp detox libncurses5 -y
 +
sudo apt install thunderbird gimp inkscape texlive libreoffice -y
 +
</pre>
  
<code>group:          compat nis</code>
+
* '''Firefox''' - should already be installed without SNAP
 
+
* '''MS Teams''' - there ''was'' a Debian release of MS Teams but this was retired - your best bet is to use MS Teams in your web browser:[https://www.microsoft.com/en-gb/microsoft-teams/log-in https://www.microsoft.com/en-gb/microsoft-teams/log-in] - make sure you give your browser permissions to access your webcam and mic
<code>shadow:        compat</code>
+
* '''MS Office''' - use the online version of Outlook/Word/Powerpoint/OneDrive: [https://m365.cloud.microsoft/ https://m365.cloud.microsoft/] - use the 3D burger in top right to change apps
 
 
<code>hosts:          files nis dns</code>
 
 
 
<code>networks:      files dns</code>
 
 
 
<code>protocols:      files</code>
 
 
 
<code>services:      files nis</code>
 
 
 
<code>ethers:        files</code>
 
 
 
<code>rpc:            files</code>
 
 
 
<code>netmasks:      files</code>
 
 
 
<code>netgroup:      nis</code>
 
 
 
<code>publickey:      files</code>
 
 
 
<code>bootparams:    files</code>
 
 
 
<code>automount:      nis files</code>
 
 
 
<code>aliases:        files nis</code>
 
 
 
- Ensure that /etc/host.conf possesses the code
 
 
 
<code>order hosts, bind</code>
 
 
 
<code>multi on</code>
 
 
 
- (Optional) Move /home to /local_home and create another /home directory with full access;
 
 
 
<code>mv /home /local_home</code>
 
 
 
<code>mkdir /home</code>
 
 
 
<code>chmod 777 /home</code>
 
 
 
- Edit /etc/passwd by adding '+::::::' to the end of the file.
 
 
 
- Edit /etc/group and add '+:::' to the end.
 
 
 
- Run below in terminal
 
 
 
<code>systemctl enable rpcbind nscd ypbind autofs</code>
 
 
 
<code>systemctl restart rpcbind nscd ypbind autofs</code>
 
 
 
- 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
 
 
 
<code>%scan  ALL=(root) ALL</code>
 
 
 
==More bits==
 
<code>aptitude full-upgrade</code>
 
 
 
<code>sudo apt-get install tcsh openssh-client openssh-server tmux</code>
 
 
 
==Fail2Ban==
 
 
 
DTS require us to have fail2ban installed on all our linux machines - MAKE SURE YOU INSTALL THIS!
 
 
 
<code>sudo apt install fail2ban</code>
 
 
 
<code>sudo systemctl enable fail2ban --now</code>
 
 
 
==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
 
<code>sudo snap remove firefox</code>
 
 
 
(2) connect to the source of firefox as deb
 
<code>sudo add-apt-repository ppa:mozillateam/ppa</code>
 
 
 
(3) prioritise the deb over the snap (cut and paste into terminal from kate or something):
 
 
 
<code>echo '</code>
 
 
 
<code>Package: *</code>
 
 
 
<code>Pin: release o=LP-PPA-mozillateam</code>
 
 
 
<code>Pin-Priority: 1001</code>
 
 
 
<code>' | sudo tee /etc/apt/preferences.d/mozilla-firefox</code>
 
 
 
(4) prevent auto updates reverting your good work (same as above):
 
 
 
<code>echo 'Unattended-Upgrade::Allowed-Origins::</code>
 
 
 
<code>"LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox </code>
 
 
 
(5) install firefox the right way
 
<code>sudo apt install firefox</code>
 
 
 
 
 
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:
 
<code>sudo dpkg -i teams_XX.deb</code> (where 'XX' is the rest of the .deb filename)
 
 
 
- If you get dependency errors then:
 
<code>sudo apt --fix-broken install</code> and repeat above
 
 
 
 
 
Microsoft doesnt support linux at the moment so use teams-for-linux
 
 
 
 
 
<code>
 
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
 
</code>
 
  
 
==Installing Matlab==
 
==Installing Matlab==
use mathworks account based on Uni email to log in
+
For the time being you should only be using Matlab 2023b - this is because Mathworks have decided from 2024a they would run an unjustifiable monitoring service which causes regular spikes in CPU usage and 100MB of log regular files to be created which are of no benefit to the user.
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:
 
 
 
<code>
 
xhost +SI:localuser:root
 
 
 
sudo -H ./install
 
 
 
</code>
 
When prompted by the installer, specify the folder for installation. this should be in /eee/MATLAB/R20XYa (what ever the release is)
 
  
<code>
+
* Go to the Mathworks website and login using your University account - if you don't have one, create one '''making sure you use your university email address''': [https://login.mathworks.com/embedded-login/landing.html?cid=getmatlab&s_tid=gn_getml https://login.mathworks.com/embedded-login/landing.html?cid=getmatlab&s_tid=gn_getml]
xhost -SI:localuser:root
+
* Click on ''Install MATLAB'', select ''R2023b' in release, and click Download for Linux
</code>
+
* Unzip the file into a folder by navigating your download folder in Terminal and entering <code>unzip matlab_R2023b_glnxa64.zip -d matlab_R2023b_glnxa64</code> - '''DO NOT USE DOLPHIN TO EXTRACT''', some files are not maintained in the correct folder structure which breaks the install
This allows the root user to access the running X server, launches the installer, and then
+
* Run the installer from the same download directory by entering <code>sudo ./matlab_R2023b_glnxa64/install</code>
removes the root user from accessing the X server.
+
* Follow the instructions in the installer - a Designated Computer license seems to be the best option - the default install location is fine with the alternate option being <code>/eee/</code> if you are looking at installing on your second hard drive - install MATLAB, Bioinfomatics Toolbox, Curve Fitting Toolbox, DSP System Toolbox, Image Acquisition Toolbox, Image Processing Toolbox, Parallel Computing Toolbox, Signal Processing Toolbox, and Statistics and Machine Learning Toolbox as a Minimum, plus any other Toolboxes you wish to install (be careful of space usage, these can be a couple of GB each) - click on the 'Create symbolic links to MATLAB scripts in:' box and unclick the 'user experience' one - click 'Begin Install' (check for sensible space usage)
  
 
==Printers==
 
==Printers==
  
The install script and drivers are in /home/share/printers/
+
The install script and drivers are in <code>/home/share/printers/</code> and run to install University printer drivers
 
 
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.
 

Latest revision as of 10:28, 26 March 2025

Pre-installation checklist

  • Download debian-12.9.0-amd64-netinst.iso - if this link is broken find another one! Mount as boot iso on a USB stick, e.g. you can use RUFUS on windows to do this or dd on linux. Skip if someone has provided a pre-configured stick to you.
  • List of installed software by you and others who use the PC and backup locally (i.e. on USB drives and not on network drives) - skip if new PC
  • Make note of your IP address and hostname (this is the same as your computer name) - talk to Rikesh or Matt if new PC
  • IMPORTANT: Print two labels - one with your IP address and one with your hostname - stick it on the front+top of your PC so that it is clearly visible to all users
  • Make sure the PC is plugged into the wall (specifically in L4)
  • If you are not be able to see the option to enter the bootup menu - find the oldest monitor you can and connect the PC to it

Installation screens

I. Boot setup

  • Interrupt the normal booting procedure for the computer - common keys for entering BIOS or boot menu are Enter/F1/F2/F11/F12/Del. If on a Lenovo PC press Enter when the Lenovo boot splash screen turns up, enter the BIOS Setup Utility menu by pressing F1 and arrow to the Startup sub-menu.
  • Enter into the Primary Boot Sequence. Change boot order from BIOS to boot from [USB HDD] or [USB CD-ROM] (very relevant for new PCs - talk to Rikesh or Matt) depending on what turns up by pressing + on the USB drive to the top of the queue.
  • Save and exit with F10.
  • If you cannot see the boot or setup menu, you may need to plug your screen into the GPU output rather than the motherboard output (or vice versa).


II. Install menu

  • The Debian splash screen should show up, select install Graphical install

1. Language

  • Select language English, United Kingdom, and British English - it will now do an initial harware/network configuration (1min)
  • The USB may fail as the installer thinks the drive is CD drive - if this happens try moving the USB drive to a port on the back of the PC

2. Configure network

  • The network autoconfiguration will fail - this is fine. Continue and select Configure network manually
  • Enter your PC's IP address (see earlier)
  • Enter 255.255.255.0 for the netmask
  • Enter 128.243.74.254 for the gateway
  • Enter 128.243.21.19 for the nameservers (DNS)
  • Enter your computer name as the hostname (this may be filled in for you already!)
  • Enter applied_optics as the domain name
  • Do not set a root password - just leave blank and click continue
  • Enter local_[hostname] for the user's name and username
  • You should already been advised what the user password should be, if not ask!
  • The install will then start looking for disks

3. Formatting Disks

  • Warning this will wipe Windows!
  • For partitioning select Manual
  • Double-click your primary hard drive which should firstly be an NVMe drive (e.g. /dev/nvme01)
  • Select 'Yes' for wiping and do the same for any other hard drives you want to wipe - make sure you DO NOT wipe your USB drive
  • Select the FREE SPACE partition under your first hard drive and create a new partition by selecting the Automatically partition the free space option - this creates sensible partitions but if you require something more specialist you should already know how to set this up
  • Select All files in one partiion - you should end up with a bootable partition in #1 (~500MB), your root / directory in #2, and swap in #3 (~1.0GB),
  • Partition your second/additional hard drives to wherever you want/need to (i.e. /eee) - this time select 'Create a new partition' - set the partition size to 'max' - to change the mount point enter manually /eee, click on Done setting up' and click on Finish partitioning and write changes to disk - select Yes to write changes to disks,
  • The installation will begin. (2mins)

4. Complete installation

  • To configure the package manager, select United Kingdom, select the top option for the software repository (e.g. deb.debian.org), and leave the proxy entry blank
  • Software and updates will start installing (1min)
  • For software popularity context select No,
  • Unselect Debian desktop environment and GNOME Flashback - select KDE Plasma and SSH server
  • Leave 'Standard system utilities' selected
  • It will then continue installing (5mins)
  • Click continue to reboot (you can pull out the USB drive after it has restarted)

Nvidia drivers

You might notice that once you log in (using local_[hostname] and password from earlier, the framerate will tank - this is because the default nouveau drivers does not work well with your Nvidia card and newer Wayland display protocol. You have two options:

1. Before login, change the Desktop Session in bottom left to Plasma (X11) (not recommended for long term)

2. Install Nvidia drivers - follow the steps below for this:

  • Firstly you must turn off Secure boot in the bios (restart and enter bios...) under 'Security' change 'Secure Boot' to disabled and hit F10 --- or enrol your system key [1] (bios should be option 1, not enrol!) - if you do not, you will get a 'Failed to start Nvidia persistence daemon' error at startup
  • Enter the commands below to install the drivers (you should be able to access this wiki page from your new PC to copy into Terminal):
sudo apt update 
sudo apt upgrade 
sudo apt install software-properties-common -y
sudo add-apt-repository main contrib non-free non-free-firmware
sudo apt update
sudo apt upgrade
sudo apt install linux-headers-amd64 nvidia-kernel-dkms -y
  • The install will complain about nouveau, click ok to replace - continue with the following commands:
echo 'options nvidia-drm modeset=1' | sudo tee -a /etc/modprobe.d/nvidia-options.conf > /dev/null
echo 'options nvidia NVreg_PreserveVideoMemoryAllocations=1' | sudo tee -a /etc/modprobe.d/nvidia-options.conf > /dev/null
sudo reboot
  • You should now be able to use the default Wayland protocol for the display

Getting on the OPG network

sudo apt update
sudo apt upgrade
sudo apt install nfs-common autofs nis nfs-kernel-server -y
echo 'applied_optics' | sudo tee -a /etc/defaultdomain > /dev/null
echo 'domain applied_optics server 128.243.74.2' | sudo tee -a /etc/yp.conf > /dev/null
echo 'ypserver 128.243.74.2' | sudo tee -a /etc/yp.conf > /dev/null
sudo sed -i 's/passwd: /passwd: compat nis /g' /etc/nsswitch.conf 
sudo sed -i 's/group: /group: compat nis /g' /etc/nsswitch.conf 
sudo sed -i 's/shadow: /shadow: compat /g' /etc/nsswitch.conf 
sudo sed -i 's/hosts: /hosts: nis /g' /etc/nsswitch.conf 
sudo sed -i 's/networks: /networks: nis dns /g' /etc/nsswitch.conf 
sudo sed -i 's/services: /services: nis /g' /etc/nsswitch.conf 
echo 'automount: nis files' | sudo tee -a /etc/nsswitch.conf > /dev/null
echo 'aliases: nis files' | sudo tee -a /etc/nsswitch.conf > /dev/null
echo 'order hosts, bind' | sudo tee -a /etc/host.conf  > /dev/null
echo '+::::::' | sudo tee -a /etc/passwd  > /dev/null
echo '+:::' | sudo tee -a /etc/group  > /dev/null
sudo sed -i '/^# Allow members /a\%scan ALL=(root) ALL' /etc/sudoers
sudo rm -R /home
sudo mkdir /home
sudo chmod 777 /home
sudo systemctl enable rpcbind --now
sudo systemctl enable nscd --now
sudo systemctl enable ypbind --now
sudo systemctl enable autofs --now
  • Reboot manually and login as yourself
  • Contact Rikesh to let him if you have successfully logged in (and confirm network access on the server side) or if you have failed

Clean up and additional software

  • REQUIRED: Run the following for clean :
sudo userdel -r local_[hostname]
sudo apt install fail2ban -y
sudo systemctl enable fail2ban --now
sudo systemctl restart fail2ban
  • Semi-optional: Install some other useful software that may come in handy in the future..
sudo apt install tcsh tmux ksh cmake git libgtk-3-dev libgtk2.0-dev default-jdk remmina xrdp detox libncurses5 -y
sudo apt install thunderbird gimp inkscape texlive libreoffice -y
  • Firefox - should already be installed without SNAP
  • MS Teams - there was a Debian release of MS Teams but this was retired - your best bet is to use MS Teams in your web browser:https://www.microsoft.com/en-gb/microsoft-teams/log-in - make sure you give your browser permissions to access your webcam and mic
  • MS Office - use the online version of Outlook/Word/Powerpoint/OneDrive: https://m365.cloud.microsoft/ - use the 3D burger in top right to change apps

Installing Matlab

For the time being you should only be using Matlab 2023b - this is because Mathworks have decided from 2024a they would run an unjustifiable monitoring service which causes regular spikes in CPU usage and 100MB of log regular files to be created which are of no benefit to the user.

  • Go to the Mathworks website and login using your University account - if you don't have one, create one making sure you use your university email address: https://login.mathworks.com/embedded-login/landing.html?cid=getmatlab&s_tid=gn_getml
  • Click on Install MATLAB, select R2023b' in release, and click Download for Linux
  • Unzip the file into a folder by navigating your download folder in Terminal and entering unzip matlab_R2023b_glnxa64.zip -d matlab_R2023b_glnxa64 - DO NOT USE DOLPHIN TO EXTRACT, some files are not maintained in the correct folder structure which breaks the install
  • Run the installer from the same download directory by entering sudo ./matlab_R2023b_glnxa64/install
  • Follow the instructions in the installer - a Designated Computer license seems to be the best option - the default install location is fine with the alternate option being /eee/ if you are looking at installing on your second hard drive - install MATLAB, Bioinfomatics Toolbox, Curve Fitting Toolbox, DSP System Toolbox, Image Acquisition Toolbox, Image Processing Toolbox, Parallel Computing Toolbox, Signal Processing Toolbox, and Statistics and Machine Learning Toolbox as a Minimum, plus any other Toolboxes you wish to install (be careful of space usage, these can be a couple of GB each) - click on the 'Create symbolic links to MATLAB scripts in:' box and unclick the 'user experience' one - click 'Begin Install' (check for sensible space usage)

Printers

The install script and drivers are in /home/share/printers/ and run to install University printer drivers