LAB_2_Guide
LAB_2_Guide
XSERVER
This exercise will test your basic understanding of these core functionalities in Linux. Remember to use the man command for detailed information on any command
you're unsure about.
1. List Installed Packages: Use the apt list --installed (Debian/Ubuntu) or yum list installed (RHEL/CentOS) command to see a list of all installed
packages.
2. Search for a Package: Use apt search <package_name> or yum list <package_name> to search for a specific package.
3. Install a Package: Simulate installing a new package using sudo apt install <package_name> or sudo yum install <package_name> .
4. Update Package Lists: Update the package list with available versions using sudo apt update or sudo yum update .
5. Upgrade Packages: Simulate upgrading all installed packages using sudo apt upgrade or sudo yum upgrade .
Part 2: XServer
1. Check XServer Status: Use ps aux | grep X to see if the X Window System is running (look for processes with "X" in the name).
2. List Display Information: Use xdpyinfo to get details about the X server and connected displays.
3. Restart XServer: Issuing sudo systemctl restart displaymanager (or similar depending on your distribution) will restart the X server, potentially causing
applications to close.
Linux Command Line Advanced Exercise: Package Management, Filesystem & XServer
Part 1: Package Management
1. Search Packages with Regular Expressions: Utilize apt search --regex <pattern> (Debian/Ubuntu) or yum list | grep <pattern> (RHEL/CentOS) to
search for packages matching a pattern (e.g., apt search --regex '^firefox' for packages starting with "firefox").
2. Install Specific Package Version: Install a specific version of a package using sudo apt install <package_name>=<version> or sudo yum install
<package_name>-<version> . (Example: sudo apt install firefox=102.0.1 for a specific Firefox version).
3. Remove a Package: Removing a package named "test_package" with sudo apt remove test_package or sudo yum remove test_package .
4. Purge a Package: Completely removing a package named "test_package" including configuration files with sudo apt purge test_package or sudo yum
remove --alldeps test_package .
5. Manage Dependencies: Use apt depends <package_name> or yum deplist <package_name> to see the dependencies of a package.
Part 2: XServer
1. List Running X Clients: Use wmctrl -l to list currently running applications/windows on the X server.
2. Manipulate Windows: Use wmctrl with options like -c (close window), -r (rename window), and -b (move window) to manage windows from the
command line (refer to man wmctrl for details).