In this lab, you will explore software distribution strategies and best practices. You will gain insights into the different approaches used to distribute software and understand the importance of effective software distribution in the development lifecycle. Follow the tasks below to complete the lab assignment.
Objective: Set up a local package repository and use it to install packages.
-
Create a Local Repository:
-
Create a directory to hold your repository and place some
.deb
files in it.mkdir -p ~/local-apt-repo cp /path/to/package.deb ~/local-apt-repo/
-
-
Generate the Package Index:
-
Use
dpkg-scanpackages
to create aPackages
file. Compress this file into aPackages.gz
archive.dpkg-scanpackages ~/local-apt-repo /dev/null | gzip -9c > ~/local-apt-repo/Packages.gz
-
-
Add the Local Repository to Your Sources List:
-
Add the repository to your
sources.list
.echo "deb [trusted=yes] file:/home/yourusername/local-apt-repo ./" | sudo tee /etc/apt/sources.list.d/local-apt-repo.list sudo apt update
-
-
Verify the Contents of the Packages.gz File::
-
Check that the Packages.gz file contains the correct paths and metadata for your .deb files, it must be relative path like
./your_package.deb
. Also you can see the package name there. Then check the repository of your package, make sure it's local one.zcat Packages.gz apt policy your-package-name
-
-
Install a Package from the Local Repository:
-
Install a package using
apt
from your local repository.sudo apt install your-package-name
-
-
Document the Process:
- Create a
submission4.md
file. - Provide step-by-step documentation of your setup and installation process in the
submission4.md
file.
- Create a
Objective: Use apt
to simulate package installation and identify dependencies without actually installing the packages.
-
Choose a Package to Simulate:
-
Select a package to simulate its installation.
apt-cache showpkg your-package-name
-
-
Simulate the Installation:
-
Use the
-s
flag to simulate the installation.sudo apt-get install -s your-package-name
-
-
Analyze the Output:
- Identify the dependencies and the packages that would be installed.
- Document the findings in the
submission4.md
file, including which dependencies are required and their versions.
Objective: Prevent a package from being upgraded and then allow it to be upgraded again.
-
Install a Package:
-
Install a package that is commonly updated.
sudo apt install your-package-name
-
-
Hold the Package:
-
Use
apt-mark
to hold the package.sudo apt-mark hold your-package-name
-
-
Verify the Hold Status:
-
Check the status of held packages.
apt-mark showhold
-
-
Unhold the Package:
-
Use
apt-mark
to unhold the package.sudo apt-mark unhold your-package-name
-
-
Documentation:
- Document the steps taken to hold and unhold the package, including any verification commands in the
submission4.md
file.
- Document the steps taken to hold and unhold the package, including any verification commands in the
- Use proper Markdown formatting for documentation files.
- Organize files with appropriate naming conventions.
- Create a Pull Request to the main branch of the repository with your completed lab assignment.
Note: Actively explore and document your findings to gain hands-on experience with
apt
and software distribution strategies.