79 lines
3.9 KiB
Markdown
79 lines
3.9 KiB
Markdown
---
|
|
status: "1-Backlog"
|
|
type: "kanbn"
|
|
created: "2024-01-06T01:22:07.429Z"
|
|
updated: "2024-01-06T01:22:07.429Z"
|
|
---
|
|
|
|
# apt-get-install
|
|
|
|
```bash
|
|
sudo -i
|
|
apt-get install links unzip net-tools ufw nginx git -y
|
|
```
|
|
|
|
```bash
|
|
# Checking your Ubuntu Version
|
|
lsb_release -a
|
|
# There are several good, effective answers listed above.
|
|
# However, this is the mechanism I personally use -- apt-ftparchive.
|
|
# I'm documenting it here, in case I need it again in the future. Perhaps it might be useful to you.
|
|
# Creating the Archive Snapshot
|
|
# Create an instance of Ubuntu that closely mimics the target environment
|
|
# For example, an Ubuntu 12.04 64-bit instance in Amazon
|
|
# Start with a clean package environment
|
|
apt-get clean
|
|
# Update the package lists
|
|
apt-get update
|
|
apt-get install libssl-dev libssl-doc
|
|
# Download all package updates available
|
|
apt-get dist-upgrade --download-only
|
|
# recursive-dependencies-of-a-debian-package
|
|
apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances smbclient | grep "^\w" | sort -u
|
|
# Download all relevant packages and dependencies
|
|
apt-get install --download-only byobu run-one bikeshed dotdee powernap
|
|
apt-get install --download-only --reinstall e2fsprogs fwupd grub-common libcups2 libglib2.0-0 netplan.io python3-systemd rsyslog smbclient
|
|
apt-get install --download-only --reinstall cdebconf coreutils debconf dpkg e2fsprogs fwupd gcc-10-base grub-common install-info libacl1 libarchive13 libasn1-8-heimdal libattr1 libaudit-common libaudit1 libavahi-client3 libavahi-common-data libavahi-common3 libbsd0 libbz2-1.0 libc6 libcap-ng0 libcap2 libcom-err2 libcrypt1 libcups2 libdb5.3 libdbus-1-3 libdebian-installer4 libexpat1 libffi7 libfuse2 libgcc-s1 libgcrypt20 libglib2.0-0 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhogweed5 libhx509-5-heimdal libicu66 libidn2-0 libjansson4 libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common libldb2 liblmdb0 liblz4-1 liblzma5 libmpdec2 libncursesw6 libnetplan0 libnettle7 libnewt0.52 libp11-kit0 libpam0g libpcre2-8-0 libpopt0 libpython3-stdlib libpython3.8 libpython3.8-minimal libpython3.8-stdlib libreadline8 libroken18-heimdal libsasl2-2 libsasl2-modules-db libselinux1 libslang2 libsmbclient libsqlite3-0 libssl1.1 libstdc++6 libsystemd0 libtalloc2 libtasn1-6 libtdb1 libtevent0 libtextwrap1 libtinfo6 libtss2-esys0 libunistring2 libuuid1 libwbclient0 libwind0-heimdal libxml2 libzstd1 mime-support netplan.io perl-base python3 python3-ldb python3-minimal python3-systemd python3-talloc python3.8 python3.8-minimal readline-common rsyslog samba-common samba-libs sensible-utils smbclient tar tzdata ucf zlib1g
|
|
# Create the package manifest
|
|
(cd /var/cache/apt/archives/ && apt-ftparchive packages . ) | tee /var/cache/apt/archives/Packages
|
|
ls /var/cache/apt/archives
|
|
# Create an archive of the packages
|
|
cd /home/unity4
|
|
tar cvf snapshot.tar -C /var/cache/apt archives/
|
|
ls /home/unity4
|
|
```
|
|
|
|
```bash
|
|
scp unity4@unity4:/home/unity4/snapshot.tar D:/Tmp/Phares/snapshot.tar
|
|
```
|
|
|
|
```bash
|
|
pscp D:/Tmp/Phares/snapshot.tar unity5@unity5:/home/unity5/snapshot.tar
|
|
```
|
|
|
|
```bash
|
|
# Using the Archive Snapshot on the Offline Target System
|
|
# Through some mechanism, you will need to get the snapshot.tar from the source to the target system.
|
|
# Perhaps on a USB stick, or otherwise.
|
|
# Extract the archive on the target system (in this case, in /home/ubuntu)
|
|
cd /home/unity5
|
|
tar xvf snapshot.tar
|
|
cd /home/unity5/archives
|
|
ls /home/unity5/archives
|
|
dpkg -i *.deb
|
|
dpkg -i smbclient_2%3a4.15.13+dfsg-0ubuntu0.20.04.2_amd64.deb
|
|
# Add the local, offline source to /etc/apt/sources.list
|
|
echo "deb file:/home/unity5/archives /" | tee -a /etc/apt/sources.list
|
|
# Update the package list
|
|
apt-get update
|
|
# Install the packages as desired
|
|
apt-get install byobu run-one bikeshed dotdee powernap
|
|
apt-get install smbclient
|
|
```
|
|
|
|
## Sub-tasks
|
|
|
|
- [x] phares3757
|
|
- [x] unity4
|
|
- [x] unity5
|