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
DockerorPodman - 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
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
-
Add the graphics drivers PPA
sudo apt update && sudo add-apt-repository ppa:graphics-drivers/ppa
-
Identify graphics card and list suggested drivers
ubuntu-drivers devicesSample== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd00001E07sv00003842sd00002382bc03sc00i00 vendor : NVIDIA Corporation model : TU102 [GeForce RTX 2080 Ti Rev. A] driver : nvidia-driver-418-server - distro non-free driver : nvidia-driver-470-server - distro non-free driver : nvidia-driver-535 - distro non-free recommended driver : nvidia-driver-545 - distro non-free driver : nvidia-driver-450-server - distro non-free driver : nvidia-driver-470 - distro non-free driver : nvidia-driver-535-server - distro non-free driver : nvidia-driver-545-open - distro non-free driver : nvidia-driver-535-server-open - distro non-free driver : nvidia-driver-535-open - distro non-free driver : xserver-xorg-video-nouveau - distro free builtin
-
Install
Autoinstallsudo ubuntu-drivers autoinstallSpecific driversudo apt install nvidia-driver-xxx -
Reboot
sudo reboot now
2.16. Install Docker or Podman
|
ONLY INSTALL ONE OR THE OTHER - A HOST CANNOT RUN BOTH! |
2.16.1. Install Podman
-
About Podman
-
Install Podman
sudo apt update && sudo apt -y install podman podman-compose
2.16.2. Install Docker
-
Install Docker
sudo apt update && sudo apt -y install docker.io -
Add User
sudo usermod -aG docker $USER -
Activate the changes to groups
newgrp docker -
Verify the ability to run docker commands without sudo
docker run hello-world
2.16.3. Install Docker Compose
-
Official documentation.
-
Install the
aptRepository-
Add Docker’s official GPG key
sudo apt-get updatesudo apt-get install ca-certificates curlsudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascsudo chmod a+r /etc/apt/keyrings/docker.asc -
Add the repository to Apt sources
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullsudo apt-get update
-
-
Install the Docker packages.
-
Install
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -
Start the docker engine
sudo service docker start -
Confirm Docker is working.
sudo docker run hello-world
-
-
Run docker without
sudocommand-
Setup
sudo groupadd dockersudo usermod -aG docker $USERnewgrp docker -
Confirm Docker is working without the
sudocommand.docker run hello-world
-
-
Configure Docker to start on boot with
systemdOn Debian and Ubuntu, the Docker service starts on boot by default sudo systemctl enable docker.servicesudo systemctl enable containerd.service -
Configure log rotation.
-
Create or edit the following file:
File name/etc/docker/daemon.jsonContent{ "log-driver": "json-file", "log-opts": { "max-size": "10m", "max-file": "3" } }
-
-
Install the Plugin
sudo apt-get install docker-compose-plugin
2.16.4. Install Docker Compose Standalone
| Not Recommended! |
-
Official documentation.
-
Run
curl -SL https://github.com/docker/compose/releases/download/v2.32.2/docker-compose-linux-x86_64 -o ./docker-compose -
Move the file
sudo mv ./docker-compose /usr/local/bin/docker-compose -
Apply executable permissions to the standalone binary in the target path for the installation
sudo chmod +x /usr/local/bin/docker-composeIf the command can’t be found, create this softlink
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-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