Topic 3: Installing and Running Packages
Installing Packages
Using Package Managers:
- Package managers like
yum
ordnf
on CentOS are the preferred way to install packages.
sudo yum install <package-name>
Resolving Dependencies:
- The package manager automatically resolves and installs any dependencies required by the package.
Removing Packages
Proper Package Removal:
- To remove a package, use the package manager.
sudo yum remove <package-name>
Handling Dependencies:
- The package manager will also handle dependencies during removal, ensuring that no other packages are affected.
Upgrading Packages
Updating to Newer Versions:
- To update a package to a newer version, use the package manager.
sudo yum update <package-name>
Managing Conflicts:
- The package manager will handle conflicts between packages, ensuring that the system remains stable.
Package Verification
Checking Package Integrity:
- You can verify the integrity of installed packages.
rpm -V <package-name>
Verifying Signatures:
- Package managers often verify package signatures to ensure they haven’t been tampered with.
sudo yum install <package-name>
Managing Services
Starting and Stopping Services:
- Use
systemctl
to start or stop services.
sudo systemctl start <service-name> sudo systemctl stop <service-name>
Enabling Services at Boot:
- To enable a service to start at boot.
sudo systemctl enable <service-name>
Assignments and Practical Exercises
- Installing Packages:
- Practice installing packages using
yum
ordnf
. They’ll be provided with a list of packages to install, and they’ll need to resolve any dependencies.
- Practice installing packages using
- Removing Packages:
- Practice removing packages using the package manager. They’ll also need to ensure that dependencies are handled properly.
- Upgrading Packages:
- Upgrade a specific package to the latest version. Use the package manager to perform the upgrade.
- Package Verification:
- Verify the integrity of an installed package and check its signature to ensure it hasn’t been tampered with.
- Managing Services:
- Practice starting, stopping, and enabling services using
systemctl
. They’ll work with both system services and any custom services they may have set up.
- Practice starting, stopping, and enabling services using
These assignments and exercises will provide hands-on experience in installing, removing, and managing packages, as well as working with services on a Unix system.