Unit4
Unit4
To install WSL distros (Linux OS) we need to have the WSL feature enabled.
Open Powershell as Administrator and run the below command.
WSL also depends on a Virtual Machine Platform, so we must enable it before installing
the Linux distros (OS).
Open Powershell as Administrator and run the below command.
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
If you want to install a new Linux distribution or even another version of Ubuntu on your
existing Ubuntu system, follow these step-by-step instructions to do so effectively. This guide
assumes you want to install a fresh version of Linux, not just update or upgrade your
current Ubuntu installation.
Step-by-Step Guide: Installing Linux on Ubuntu
1. Choose a Linux Distribution: For this guide, we'll assume you're installing Ubuntu,
but you can follow similar steps for other distributions like Linux Mint, Fedora, etc.
2. Download the ISO:
o Go to the official Ubuntu website: Download Ubuntu.
o Download the appropriate version (usually, the desktop version for most
users).
To install Linux, you will need to create a bootable USB stick that you can boot from to start
the installation process.
1. Insert a USB Drive: Insert a USB stick with at least 4 GB of space into your
computer.
2. Open Startup Disk Creator:
o Press the Super key (Windows key), search for Startup Disk Creator, and
open it.
3. Select the ISO File:
o In the Startup Disk Creator, click Other to select the downloaded ISO file of
the Linux distribution.
4. Select the USB Drive:
o Choose your USB stick from the list of available drives.
5. Create the Bootable Disk:
o Click Make Startup Disk to begin creating the bootable USB.
o Wait for the process to complete (it may take several minutes depending on the
USB speed).
If you are installing Linux on a system with existing data or another OS (e.g.,
Windows), backup your important files before proceeding. Installing Linux may
erase your data if you're not careful.
1. Restart Your Computer: Insert the bootable USB drive and restart your computer.
2. Access BIOS/UEFI:
o As your computer restarts, press the BIOS/UEFI access key (this is often F2,
F10, DEL, or ESC, depending on the manufacturer).
o Consult your laptop/PC manual if you're unsure which key to press.
3. Set USB as Boot Device:
o In the BIOS/UEFI menu, go to the Boot Options section.
o Select the USB drive as the primary boot device.
4. Save and Exit: Save the settings and exit the BIOS. Your system should now boot
from the USB drive.
1. Select your keyboard layout (most users can choose English (US)).
2. Click Continue.
o After selecting your preferred installation type, click Install Now. A warning
will appear asking if you're sure you want to proceed (as this could erase data),
so confirm by clicking Continue.
1. Enter your name, username, and password. This will be your login information.
2. You can also select whether you want automatic login (no password needed on
startup) or require the password every time you log in.
3. Click Continue.
The installation process will begin. This may take 10-30 minutes depending on your
system's speed.
The installer will copy files and set up the system. During this time, you may see
additional prompts about installing software, third-party drivers, or updates.
1. Once the installation finishes, you’ll be asked to remove the installation media (the
USB drive).
2. Click "Restart Now".
3. Your system will restart and boot into the newly installed Linux OS.
1. Log in using the username and password you created during the installation.
2. After logging in, you’ll be in your new Linux environment. Explore the system, and
make sure everything is working as expected.
1. It's a good idea to update your system to the latest software versions and security
patches.
2. Open a Terminal (press Ctrl + Alt + T), and run the following commands:
o This will update your package list and install any available updates.
Linux/Unix/Unix-Like Systems
For most such systems, you can probably use the OSs package manager to install a pre-built
binary package. This is always the recommended method.
Linux user
A root or super user can access all the files, while the normal user has limited access
to files.
A super user can add, delete and modify a user account. The full account information
is stored in the /etc/passwd file and a hash password is stored in the file /etc/shadow.
Some operations on a user account are discussed below.
Creating a user with a default setting: A user can be added by running the user add
command at the command prompt. After creating the user, set a password using the
passwd utility.
o The system automatically assigns a UID, creates the home directory
(/home/<username>) and sets the default shell to /bin/bash.
o The useradd command creates a user private group whenever a new user is
added to the system and names the group after the user.
Locking and unlocking a user: A super user can lock and unlock a user account.
o To lock an account, one needs to invoke passwd with the -l option.
o To unlock an account, one needs to invoke passwd with the -u option.
Changing a user name: The –l option with the usermod command changes the login
(user)
Removing a user: Combining userdel with the –r option drop a user and the home
directory associated with that user.
Linux group
Linux group is a mechanism to organize a collection of users. Like the user ID, each
group is also associated with a unique ID called the GID (group ID).
There are two types of groups –
1. a primary group
2. a supplementary group.
Each user is a member of a primary group and of zero or ‘more than zero’
supplementary groups.
The group information is stored in /etc/group and the respective passwords are stored
in the /etc/gshadow file.
Some operations such as creating, deleting and modifying on a group are below.
Creating a group with default settings: To add a new group with default settings, run
the groupadd command as a root user.
If you wish to add a password, then type gpasswd with the group name.
Creating a group with a specified GID: To explicitly specify the GID of a group,
execute the groupadd command with the –g option.
Removing group password: To remove a group password, run gpasswd –r with the
relevant group name
Changing the group’s name: To change the group’s name, run the groupmod
command with the -n option as a super user
Changing the group’s GID: To change the GID of a group, run the groupmod
command with –g
Deleting a group: Before deleting a primary group, delete the users of that primary
group. To delete a group, run the groupdel command with the group name