Ubuntu Linux Install
- 1. Ubuntu Linux Install
- 2. Post Install
- 2.1. Install Net Tools
- 2.2. Install SSH server
- 2.3. WiFi
- 2.4. Set the Time Zone
- 2.5. Perform Updates and Upgrades
- 2.6. Install iotop
- 2.7. Install dnslookup
- 2.8. Install NetCat
- 2.9. Install Nmap
- 2.10. Install Curl
- 2.11. Install IPMI Tools
- 2.12. Install Samba
- 2.13. Install ZFS
- 2.14. Install GPU Drivers
- 2.15. Install GPU Utils
- 2.16. Install Podman
- 2.17. Install
npx - 2.18. Install
git - 2.19. Install Visual Studio Code
- 2.20. Install Cockpit
- 2.21. Install Browsers
- 3. Resize Swap File
- 4. Expand Root Partition
1. Ubuntu Linux Install
Download and install the lastest Ubuntu in a Windows Hyper-V VM or on physical hardware.
2. Post Install
2.2. Install SSH server
-
Install
sudo apt -y install openssh-server -
Now you can connect remotely via
sshand continue with the remaining steps.
2.3. WiFi
2.3.1. WiFi Test
-
Run
Runsudo lshw -C networkSample*-network UNCLAIMED description: Network controller product: Wireless 8265 / 8275 vendor: Intel Corporation physical id: 0 bus info: pci@0000:06:00.0 version: 78 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress cap_list configuration: latency=0 resources: memory:dc000000-dc001fff
2.4. Set the Time Zone
-
View the current time zone
timedatectlExampleLocal time: Sun 2023-05-21 04:20:25 SST Universal time: Sun 2023-05-21 15:20:25 UTC RTC time: Sun 2023-05-21 15:20:25 Time zone: Pacific/Pago_Pago (SST, -1100) System clock synchronized: yes NTP service: active RTC in local TZ: no -
If the time and timezone are already correct, then skip over this section.
-
View available Timezones
timedatectl list-timezones | grep New_YorkExample US TimezonesAmerica/New_York -
Set the Timezone
sudo timedatectl set-timezone America/New_York -
Confirm new Timezone
timedatectlNew TimezoneLocal time: Sun 2024-03-31 20:19:09 EDT Universal time: Mon 2024-04-01 00:19:09 UTC RTC time: Mon 2024-04-01 00:19:09 Time zone: America/New_York (EDT, -0400) System clock synchronized: yes NTP service: active RTC in local TZ: no
2.5. Perform Updates and Upgrades
| This will take a few minutes to complete… |
-
Updates and Upgrades
sudo apt update -y && sudo apt upgrade -y -
Reboot
sudo reboot now
2.6. Install iotop
-
Install
sudo apt install iotopLike the topcommand but for disk activity, disk io
2.12. Install Samba
2.12.1. Install Samba
-
Install
sudo apt-get install samba -ysudo apt-get install keyutilssudo apt-get install cifs-utilssudo apt install smbclient -
Start Samba
sudo systemctl enable --now smbd -
Create new Group for Samba
sudo addgroup sambagroup -
Add User into new Group for Samba
-
Add user to group
sudo usermod -aG sambagroup mattosd -
Confirm User added to new group
id mattosdExampleuid=1000(mattosd) gid=1000(mattosd) groups=1000(mattosd),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),134(lxd),135(sambashare),1001(sambagroup)
-
2.12.2. Add User
-
Configure user name & password
sudo smbpasswd -a mattosd (1)(2)1 Must be an actual local account name 2 This password is for Samba use only - it can be different from the account’s password but if it is the same as the network password, then credentials will not need to be provided for the connection. -
Enable User
sudo smbpasswd -e mattosd
2.13. Install ZFS
-
Install
sudo apt update && sudo apt install -y zfsutils-linux -
Confirm
zfs --versionexamplezfs-2.1.5-1ubuntu6~22.04.4 zfs-kmod-2.2.0-0ubuntu1~23.10.2
2.14. Install GPU Drivers
2.14.1. NVidia
-
Reference this Nvidia doc.
2.16. Install Podman
-
About Podman
-
Install Podman
sudo apt update && sudo apt -y install podman podman-compose
2.17. Install npx
-
The primary purpose of npx is to execute packages. Without installing, it can run any package you want from the npm registry. This is particularly useful when you want to run the package only once and want to avoid installing it globally or locally.
-
Install
npmsudo apt install -y npm
-
2.19. Install Visual Studio Code
-
Install
-
Original install doc can be referenced here.
-
If Snap is installed then:
sudo snap install --classic code
-
2.20. Install Cockpit
-
Reference this doc: Linux Cockpit Notes
2.21. Install Browsers
2.21.1. Install Brave
-
Get Brave
sudo apt install curlsudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpgecho "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.listsudo apt update -
Install Brave
sudo apt install brave-browser -y
2.21.2. Install Microsoft Edge
-
Get Edge
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpgsudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'sudo rm microsoft.gpg -
Install Edge
sudo apt update && sudo apt install microsoft-edge-stable
3. Resize Swap File
-
Check size and confirm swap
type= fileswapon --showExample with a 1GB swap fileNAME TYPE SIZE USED PRIO /swapfile file 923.2M 245.5M -2Partition TypeHowever iftype= partition, then a file partioning app will need to be used instead.Example with a 2GB partition based swapNAME TYPE SIZE USED PRIO /dev/sde2 partition 2G 1.5G -2 (1)1 The second partition on disk e is configured as a temp partition -
Turn off swap
sudo swapoff /swapfileThis may take some time and will not produce any progress related output. -
Allocate a new swap file
Allocate a 4GB filesudo fallocate -l 4G /swapfile -
Mark this file as the swapfile
sudo mkswap /swapfileExamplesudo mkswap /swapfile mkswap: /swapfile: warning: wiping old swap signature. Setting up swapspace version 1, size = 4 GiB (4294963200 bytes) -
Enable the swapfile
sudo swapon /swapfile -
Confirm swap is re-enabled with new size
swapon --showExample with new 4GB swapfileswapon --show NAME TYPE SIZE USED PRIO /swapfile file 4G 737.7M -2
4. Expand Root Partition
-
Upon initial build, the root file system is max 100GB so there is available capacity for creating additional partitions.
-
To Expand
-
Run
lsblkto identify the root disk and partition name:lsblkExamplesda 8:0 0 931.5G 0 disk (1) ├─sda1 8:1 0 1M 0 part ├─sda2 8:2 0 2G 0 part /boot └─sda3 8:3 0 929.5G 0 part (2) └─ubuntu--vg-ubuntu--lv 252:0 0 100G 0 lvm / (3)1 Root disk sdawith total disk size ~ 1TB2 Partition name, sda33 Root file system at 100GB -
Get the root file system name:
df -hTSample outputFilesystem Type Size Used Avail Use% Mounted on tmpfs tmpfs 6.1G 4.7M 6.1G 1% /run /dev/mapper/ubuntu--vg-ubuntu--lv ext4 98G 15G 79G 16% / -
Extend the LVM logical volume and resize the filesystem using the free space already available in the LVM volume group.
extendsudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lvresizesudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv -
Confirm
df -hTFilesystem Type Size Used Avail Use% Mounted on tmpfs tmpfs 6.1G 4.7M 6.1G 1% /run /dev/mapper/ubuntu--vg-ubuntu--lv ext4 915G 15G 862G 2% /
-