Create Local APT Repository in Ubuntu 20.04 LTS - CentLinux

Latest

Friday, 2 April 2021

Create Local APT Repository in Ubuntu 20.04 LTS

create-local-apt-repository-in-ubuntu-lts

In this guide, you will learn, how to create a local APT repository on your Ubuntu 20.04 LTS operating system.

 

Table of Contents:

     

    What is APT? :

    Advanced Package Tool, or APT, is a free-software user interface that works with core libraries to handle the installation and removal of software on Debian, Ubuntu, and related Linux distributions.

    In Ubuntu Linux, APT repository is the primary source of installing stable and supported software packages on your Operating System.

    Online APT repositories are available free of cost specific to different versions of Ubuntu and related distributions.

    However, there are situations, where we do not have access to Internet or our Ubuntu machines are not connected to Internet due to some security reasons.

    In such cases, you can setup your own local APT repository and use it to install software packages on your Ubuntu machines.

     

    Environment Specification:

    We are using a minimal Ubuntu 20.04 LTS virtual machine with following specifications.

    • CPU - 3.4 Ghz (2 cores)
    • Memory - 2 GB
    • Storage - 20 GB
    • Operating System - Ubuntu Server 20.04 LTS
    • Hostname – local-apt-repo.centlinux.com
    • IP Address - 192.168.116.239 /24

     

    Updating List of Available APT Packages:

    Update APT packages list by executing following command at Linux shell.

    ahmer@local-apt-repo:~$ sudo apt-get update Hit:1 http://pk.archive.ubuntu.com/ubuntu focal InRelease Get:2 http://pk.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] Get:3 http://pk.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB] Get:4 http://pk.archive.ubuntu.com/ubuntu focal-security InRelease [109 kB] Get:5 http://pk.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [890 kB] Get:6 http://pk.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [207 kB] Get:7 http://pk.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [12.9 kB] Get:8 http://pk.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [171 kB] Get:9 http://pk.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [25.3 kB] Get:10 http://pk.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [755 kB] Get:11 http://pk.archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [159 kB] Get:12 http://pk.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [16.5 kB] Get:13 http://pk.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [4,032 B] Get:14 http://pk.archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [224 B] Get:15 http://pk.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [574 kB] Get:16 http://pk.archive.ubuntu.com/ubuntu focal-security/main Translation-en [120 kB] Get:17 http://pk.archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [7,376 B] Get:18 http://pk.archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [148 kB] Get:19 http://pk.archive.ubuntu.com/ubuntu focal-security/restricted Translation-en [21.6 kB] Get:20 http://pk.archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [550 kB] Get:21 http://pk.archive.ubuntu.com/ubuntu focal-security/universe Translation-en [81.2 kB] Get:22 http://pk.archive.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [10.7 kB] Fetched 4,078 kB in 23s (174 kB/s) Reading package lists... Done

     

    Installing DPKG-DEV Package on Ubuntu 20.04 LTS:

    You are required to install dpkg-dev package, to create the packages meta data for your local APT repository.

    ahmer@local-apt-repo:~$ sudo apt-get install -y dpkg-dev Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-9 fakeroot g++ g++-9 gcc gcc-9 gcc-9-base libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-9-dev libgomp1 libisl22 libitm1 liblsan0 libmpc3 libquadmath0 libstdc++-9-dev libtsan0 libubsan1 linux-libc-dev make manpages-dev Suggested packages: binutils-doc cpp-doc gcc-9-locales debian-keyring g++-multilib g++-9-multilib gcc-9-doc gcc-multilib autoconf automake libtool flex bison gdb gcc-doc gcc-9-multilib glibc-doc bzr libstdc++-9-doc make-doc The following NEW packages will be installed: binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-9 dpkg-dev fakeroot g++ g++-9 gcc gcc-9 gcc-9-base libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-9-dev libgomp1 libisl22 libitm1 liblsan0 libmpc3 libquadmath0 libstdc++-9-dev libtsan0 libubsan1 linux-libc-dev make manpages-dev 0 upgraded, 41 newly installed, 0 to remove and 23 not upgraded. Need to get 40.0 MB of archives. After this operation, 175 MB of additional disk space will be used. ... update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode Setting up make (4.2.1-1.2) ... Setting up libquadmath0:amd64 (10.2.0-5ubuntu1~20.04) ... Setting up libmpc3:amd64 (1.1.0-1) ... Setting up libatomic1:amd64 (10.2.0-5ubuntu1~20.04) ... Setting up libdpkg-perl (1.19.7ubuntu3) ... Setting up libubsan1:amd64 (10.2.0-5ubuntu1~20.04) ... Setting up libcrypt-dev:amd64 (1:4.4.10-10ubuntu4) ... Setting up libisl22:amd64 (0.22.1-1) ... Setting up libbinutils:amd64 (2.34-6ubuntu1.1) ... Setting up libc-dev-bin (2.31-0ubuntu9.2) ... Setting up libalgorithm-diff-xs-perl (0.04-6) ... Setting up libcc1-0:amd64 (10.2.0-5ubuntu1~20.04) ... Setting up liblsan0:amd64 (10.2.0-5ubuntu1~20.04) ... Setting up libitm1:amd64 (10.2.0-5ubuntu1~20.04) ... Setting up gcc-9-base:amd64 (9.3.0-17ubuntu1~20.04) ... Setting up libalgorithm-merge-perl (0.08-3) ... Setting up libtsan0:amd64 (10.2.0-5ubuntu1~20.04) ... Setting up libctf0:amd64 (2.34-6ubuntu1.1) ... Setting up libasan5:amd64 (9.3.0-17ubuntu1~20.04) ... Setting up cpp-9 (9.3.0-17ubuntu1~20.04) ... Setting up libc6-dev:amd64 (2.31-0ubuntu9.2) ... Setting up binutils-x86-64-linux-gnu (2.34-6ubuntu1.1) ... Setting up binutils (2.34-6ubuntu1.1) ... Setting up dpkg-dev (1.19.7ubuntu3) ... Setting up libgcc-9-dev:amd64 (9.3.0-17ubuntu1~20.04) ... Setting up cpp (4:9.3.0-1ubuntu2) ... Setting up gcc-9 (9.3.0-17ubuntu1~20.04) ... Setting up libstdc++-9-dev:amd64 (9.3.0-17ubuntu1~20.04) ... Setting up gcc (4:9.3.0-1ubuntu2) ... Setting up g++-9 (9.3.0-17ubuntu1~20.04) ... Setting up g++ (4:9.3.0-1ubuntu2) ... update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode Setting up build-essential (12.8ubuntu1.1) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ...

     

    Installing Apache Web Server on Ubuntu 20.4 LTS:

    If you are planning to configure your local APT repository for use by other Ubuntu 20.04 LTS machines on your network. Then you should install Apache web server to host your APT repository.

    ahmer@local-apt-repo:~$ sudo apt-get install -y apache2 Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libjansson4 liblua5.2-0 ssl-cert Suggested packages: apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser openssl-blacklist The following NEW packages will be installed: apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libjansson4 liblua5.2-0 ssl-cert 0 upgraded, 11 newly installed, 0 to remove and 45 not upgraded. Need to get 1,865 kB of archives. After this operation, 8,080 kB of additional disk space will be used. Get:1 http://pk.archive.ubuntu.com/ubuntu focal/main amd64 libapr1 amd64 1.6.5-1ubuntu1 [91.4 kB] Get:2 http://pk.archive.ubuntu.com/ubuntu focal/main amd64 libaprutil1 amd64 1.6.1-4ubuntu2 [84.7 kB] Get:3 http://pk.archive.ubuntu.com/ubuntu focal/main amd64 libaprutil1-dbd-sqlite3 amd64 1.6.1-4ubuntu2 [10.5 kB] Get:4 http://pk.archive.ubuntu.com/ubuntu focal/main amd64 libaprutil1-ldap amd64 1.6.1-4ubuntu2 [8,736 B] Get:5 http://pk.archive.ubuntu.com/ubuntu focal/main amd64 libjansson4 amd64 2.12-1build1 [28.9 kB] Get:6 http://pk.archive.ubuntu.com/ubuntu focal/main amd64 liblua5.2-0 amd64 5.2.4-1.1build3 [106 kB] Get:7 http://pk.archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2-bin amd64 2.4.41-4ubuntu3.1 [1,180 kB] Get:8 http://pk.archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2-data all 2.4.41-4ubuntu3.1 [158 kB] Get:9 http://pk.archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2-utils amd64 2.4.41-4ubuntu3.1 [83.8 kB] Get:10 http://pk.archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2 amd64 2.4.41-4ubuntu3.1 [95.5 kB] Get:11 http://pk.archive.ubuntu.com/ubuntu focal/main amd64 ssl-cert all 1.0.39 [17.0 kB] Fetched 1,865 kB in 9s (210 kB/s) Preconfiguring packages ... Selecting previously unselected package libapr1:amd64. (Reading database ... 76848 files and directories currently installed.) Preparing to unpack .../00-libapr1_1.6.5-1ubuntu1_amd64.deb ... Unpacking libapr1:amd64 (1.6.5-1ubuntu1) ... Selecting previously unselected package libaprutil1:amd64. Preparing to unpack .../01-libaprutil1_1.6.1-4ubuntu2_amd64.deb ... Unpacking libaprutil1:amd64 (1.6.1-4ubuntu2) ... Selecting previously unselected package libaprutil1-dbd-sqlite3:amd64. Preparing to unpack .../02-libaprutil1-dbd-sqlite3_1.6.1-4ubuntu2_amd64.deb ... Unpacking libaprutil1-dbd-sqlite3:amd64 (1.6.1-4ubuntu2) ... Selecting previously unselected package libaprutil1-ldap:amd64. Preparing to unpack .../03-libaprutil1-ldap_1.6.1-4ubuntu2_amd64.deb ... Unpacking libaprutil1-ldap:amd64 (1.6.1-4ubuntu2) ... Selecting previously unselected package libjansson4:amd64. Preparing to unpack .../04-libjansson4_2.12-1build1_amd64.deb ... Unpacking libjansson4:amd64 (2.12-1build1) ... Selecting previously unselected package liblua5.2-0:amd64. Preparing to unpack .../05-liblua5.2-0_5.2.4-1.1build3_amd64.deb ... Unpacking liblua5.2-0:amd64 (5.2.4-1.1build3) ... Selecting previously unselected package apache2-bin. Preparing to unpack .../06-apache2-bin_2.4.41-4ubuntu3.1_amd64.deb ... Unpacking apache2-bin (2.4.41-4ubuntu3.1) ... Selecting previously unselected package apache2-data. Preparing to unpack .../07-apache2-data_2.4.41-4ubuntu3.1_all.deb ... Unpacking apache2-data (2.4.41-4ubuntu3.1) ... Selecting previously unselected package apache2-utils. Preparing to unpack .../08-apache2-utils_2.4.41-4ubuntu3.1_amd64.deb ... Unpacking apache2-utils (2.4.41-4ubuntu3.1) ... Selecting previously unselected package apache2. Preparing to unpack .../09-apache2_2.4.41-4ubuntu3.1_amd64.deb ... Unpacking apache2 (2.4.41-4ubuntu3.1) ... Selecting previously unselected package ssl-cert. Preparing to unpack .../10-ssl-cert_1.0.39_all.deb ... Unpacking ssl-cert (1.0.39) ... Setting up libapr1:amd64 (1.6.5-1ubuntu1) ... Setting up libjansson4:amd64 (2.12-1build1) ... Setting up ssl-cert (1.0.39) ... Setting up liblua5.2-0:amd64 (5.2.4-1.1build3) ... Setting up apache2-data (2.4.41-4ubuntu3.1) ... Setting up libaprutil1:amd64 (1.6.1-4ubuntu2) ... Setting up libaprutil1-ldap:amd64 (1.6.1-4ubuntu2) ... Setting up libaprutil1-dbd-sqlite3:amd64 (1.6.1-4ubuntu2) ... Setting up apache2-utils (2.4.41-4ubuntu3.1) ... Setting up apache2-bin (2.4.41-4ubuntu3.1) ... Setting up apache2 (2.4.41-4ubuntu3.1) ... Enabling module mpm_event. Enabling module authz_core. Enabling module authz_host. Enabling module authn_core. Enabling module auth_basic. Enabling module access_compat. Enabling module authn_file. Enabling module authz_user. Enabling module alias. Enabling module dir. Enabling module autoindex. Enabling module env. Enabling module mime. Enabling module negotiation. Enabling module setenvif. Enabling module filter. Enabling module deflate. Enabling module status. Enabling module reqtimeout. Enabling conf charset. Enabling conf localized-error-pages. Enabling conf other-vhosts-access-log. Enabling conf security. Enabling conf serve-cgi-bin. Enabling site 000-default. Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service. Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service. Processing triggers for ufw (0.36-6) ... Processing triggers for systemd (245.4-4ubuntu3.4) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ...

     

    Configure Ubuntu Firewall:

    Allow Apache service port in Linux firewall by executing ufw command.

    ahmer@local-apt-repo:~$ sudo ufw allow http Rules updated Rules updated (v6)

     

    Create APT Repository Directory:

    Create a directory 'repo' within Apache document root, to host your local APT repository.

    ahmer@local-apt-repo:~$ sudo mkdir /var/www/html/repo

    Mount the Ubuntu DVD at /mnt/cdrom.

    ahmer@local-apt-repo:~$ sudo mkdir /mnt/cdrom ahmer@local-apt-repo:~$ sudo mount /dev/cdrom /mnt/cdrom mount: /mnt/cdrom: WARNING: device write-protected, mounted read-only.

    Find and copy all the *.deb packages into our local APT repository.

    ahmer@local-apt-repo:~$ sudo find /mnt/cdrom -iname *.deb -exec cp {} /var/www/html/repo \;

    Check the files that was copied by previous command.

    ahmer@local-apt-repo:~$ ls /var/www/html/repo/ amd64-microcode_3.20191218.1ubuntu1_amd64.deb crda_3.18-1build1_amd64.deb efibootmgr_17-1_amd64.deb grub2-common_2.04-1ubuntu26.8_amd64.deb grub-common_2.04-1ubuntu26.8_amd64.deb grub-efi_2.04-1ubuntu26.8_amd64.deb grub-efi-amd64_2.04-1ubuntu26.8_amd64.deb grub-efi-amd64-bin_2.04-1ubuntu26.8_amd64.deb grub-efi-amd64-signed_1.142.10+2.04-1ubuntu26.8_amd64.deb grub-gfxpayload-lists_0.7_amd64.deb grub-pc_2.04-1ubuntu26.8_amd64.deb grub-pc-bin_2.04-1ubuntu26.8_amd64.deb intel-microcode_3.20201110.0ubuntu0.20.04.2_amd64.deb iucode-tool_2.3.1-1_amd64.deb iw_5.4-1_amd64.deb jfsutils_1.1.15-4_amd64.deb kpartx-boot_0.8.3-1ubuntu2_all.deb libdbus-glib-1-2_0.110-5fakssync1_amd64.deb libfreetype6_2.10.1-2ubuntu0.1_amd64.deb libnl-3-200_3.4.0-1_amd64.deb libnl-genl-3-200_3.4.0-1_amd64.deb libnvpair1linux_0.8.3-1ubuntu12.6_amd64.deb libuutil1linux_0.8.3-1ubuntu12.6_amd64.deb libwrap0_7.6.q-30_amd64.deb libzfs2linux_0.8.3-1ubuntu12.6_amd64.deb libzpool2linux_0.8.3-1ubuntu12.6_amd64.deb linux-firmware_1.187.9_all.deb linux-generic_5.4.0.65.68_amd64.deb linux-generic-hwe-20.04_5.8.0.41.46~20.04.27_amd64.deb linux-headers-5.4.0-65_5.4.0-65.73_all.deb linux-headers-5.4.0-65-generic_5.4.0-65.73_amd64.deb linux-headers-5.8.0-41-generic_5.8.0-41.46~20.04.1_amd64.deb linux-headers-generic_5.4.0.65.68_amd64.deb linux-headers-generic-hwe-20.04_5.8.0.41.46~20.04.27_amd64.deb linux-hwe-5.8-headers-5.8.0-41_5.8.0-41.46~20.04.1_all.deb linux-image-5.4.0-65-generic_5.4.0-65.73_amd64.deb linux-image-5.8.0-41-generic_5.8.0-41.46~20.04.1_amd64.deb linux-image-generic_5.4.0.65.68_amd64.deb linux-image-generic-hwe-20.04_5.8.0.41.46~20.04.27_amd64.deb linux-modules-5.4.0-65-generic_5.4.0-65.73_amd64.deb linux-modules-5.8.0-41-generic_5.8.0-41.46~20.04.1_amd64.deb linux-modules-extra-5.4.0-65-generic_5.4.0-65.73_amd64.deb linux-modules-extra-5.8.0-41-generic_5.8.0-41.46~20.04.1_amd64.deb mokutil_0.3.0+1538710437.fb6250f-1_amd64.deb multipath-tools-boot_0.8.3-1ubuntu2_all.deb ncurses-term_6.2-0ubuntu2_all.deb openssh-server_8.2p1-4ubuntu0.1_amd64.deb openssh-sftp-server_8.2p1-4ubuntu0.1_amd64.deb os-prober_1.74ubuntu2_amd64.deb reiserfsprogs_3.6.27-3_amd64.deb shim_15+1552672080.a4a1fbe-0ubuntu2_amd64.deb shim-signed_1.40.4+15+1552672080.a4a1fbe-0ubuntu2_amd64.deb ssh-import-id_5.10-0ubuntu1_all.deb thermald_1.9.1-1ubuntu0.3_amd64.deb wireless-regdb_2020.11.20-0ubuntu1~20.04.1_all.deb zfs-initramfs_0.8.3-1ubuntu12.6_amd64.deb zfsutils-linux_0.8.3-1ubuntu12.6_amd64.deb zfs-zed_0.8.3-1ubuntu12.6_amd64.deb

     

    Write Script to Update Package.gz File:

    Create a script file to scan and update the Packages.gz file.

    It is required, because you may add new .deb packages in your local APT repository, time to time. Therefore, you are required to update the Packages.gz file, each time after add a new .deb file in repo directory.

    ahmer@local-apt-repo:~$ sudo nano /bin/update-mydebs

    Add following lines of code in this file.

    #!/bin/bash cd /var/www/html/repo dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz

    Grant execute permissions to update-mydebs script.

    ahmer@local-apt-repo:~$ sudo chmod u+x /bin/update-mydebs

    Now, execute this script to create or update Packages.gz file.

    ahmer@local-apt-repo:~$ sudo /bin/update-mydebs dpkg-scanpackages: warning: Packages in archive but missing from override file: dpkg-scanpackages: warning: amd64-microcode crda efibootmgr grub-common grub-efi grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common intel-microcode iucode-tool iw jfsutils kpartx-boot libdbus-glib-1-2 libfreetype6 libnl-3-200 libnl-genl-3-200 libnvpair1linux libuutil1linux libwrap0 libzfs2linux libzpool2linux linux-firmware linux-generic linux-generic-hwe-20.04 linux-headers-5.4.0-65 linux-headers-5.4.0-65-generic linux-headers-5.8.0-41-generic linux-headers-generic linux-headers-generic-hwe-20.04 linux-hwe-5.8-headers-5.8.0-41 linux-image-5.4.0-65-generic linux-image-5.8.0-41-generic linux-image-generic linux-image-generic-hwe-20.04 linux-modules-5.4.0-65-generic linux-modules-5.8.0-41-generic linux-modules-extra-5.4.0-65-generic linux-modules-extra-5.8.0-41-generic mokutil multipath-tools-boot ncurses-term openssh-server openssh-sftp-server os-prober reiserfsprogs shim shim-signed ssh-import-id thermald wireless-regdb zfs-initramfs zfs-zed zfsutils-linux dpkg-scanpackages: info: Wrote 58 entries to output Packages file.

    Your local APT repository has been successfully setup. You can now add it in the sources.list file of your Ubuntu 20.04 machines.

     

    Add Your APT Repository in Ubuntu Sources.list:

    Edit sources.list file in nano text editor.

    ahmer@local-apt-repo:~$ sudo nano /etc/apt/sources.list

    And add following lines at the end of this file.

    # Local APT Repository deb [allow-insecure=yes] http://local-apt-repo.centlinux.com/repo ./

    Execute apt-get command to update packages list.

    ahmer@local-apt-repo:~$ sudo apt-get update Ign:1 http://local-apt-repo.centlinux.com/repo ./ InRelease Ign:2 http://local-apt-repo.centlinux.com/repo ./ Release Ign:3 http://local-apt-repo.centlinux.com/repo ./ Packages Ign:4 http://local-apt-repo.centlinux.com/repo ./ Translation-en Ign:5 http://local-apt-repo.centlinux.com/repo ./ Translation-en_US Ign:3 http://local-apt-repo.centlinux.com/repo ./ Packages Ign:4 http://local-apt-repo.centlinux.com/repo ./ Translation-en Ign:5 http://local-apt-repo.centlinux.com/repo ./ Translation-en_US Ign:3 http://local-apt-repo.centlinux.com/repo ./ Packages Ign:4 http://local-apt-repo.centlinux.com/repo ./ Translation-en Ign:5 http://local-apt-repo.centlinux.com/repo ./ Translation-en_US Get:3 http://local-apt-repo.centlinux.com/repo ./ Packages [18.0 kB] Ign:4 http://local-apt-repo.centlinux.com/repo ./ Translation-en Ign:5 http://local-apt-repo.centlinux.com/repo ./ Translation-en_US Ign:4 http://local-apt-repo.centlinux.com/repo ./ Translation-en Ign:5 http://local-apt-repo.centlinux.com/repo ./ Translation-en_US Ign:4 http://local-apt-repo.centlinux.com/repo ./ Translation-en Ign:5 http://local-apt-repo.centlinux.com/repo ./ Translation-en_US Ign:4 http://local-apt-repo.centlinux.com/repo ./ Translation-en Ign:5 http://local-apt-repo.centlinux.com/repo ./ Translation-en_US Hit:6 http://pk.archive.ubuntu.com/ubuntu focal InRelease Hit:7 http://pk.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:8 http://pk.archive.ubuntu.com/ubuntu focal-backports InRelease Hit:9 http://pk.archive.ubuntu.com/ubuntu focal-security InRelease Fetched 18.0 kB in 3s (5,846 B/s) Reading package lists... Done W: The repository 'http://local-apt-repo.centlinux.com/repo ./ Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details.

    Ignore the warning about the release file.

    Try to install a package from your local APT repository.

    ahmer@local-apt-repo:~$ sudo apt install jfsutils Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: jfsutils 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 195 kB of archives. After this operation, 1,616 kB of additional disk space will be used. WARNING: The following packages cannot be authenticated! jfsutils Install these packages without verification? [y/N] y Get:1 http://local-apt-repo.centlinux.com/repo ./ jfsutils 1.1.15-4 [195 kB] Fetched 195 kB in 0s (3,991 kB/s) Selecting previously unselected package jfsutils. (Reading database ... 77573 files and directories currently installed.) Preparing to unpack .../jfsutils_1.1.15-4_amd64.deb ... Unpacking jfsutils (1.1.15-4) ... Setting up jfsutils (1.1.15-4) ... update-initramfs: deferring update (trigger activated) Processing triggers for man-db (2.9.1-1) ... Processing triggers for initramfs-tools (0.136ubuntu6.3) ... update-initramfs: Generating /boot/initrd.img-5.4.0-66-generic

    Your required package has been installed successfully.

     

    Conclusion:

    In this article, you have successfully create a local APT repository on Ubuntu 20.04 LTS.

    No comments:

    Post a comment