Score:1

Downloading packages from ubuntu repositories (apt) manually using wget

cn flag

I want to learn about how apt works & fetches objects from mirrors in sources.list. How can I browse these repositories manually, download them manually & build them manually (not using source and not github, etc...)?

user535733 avatar
cn flag
You can browse using any web browser. A proper apt source is an ordinary URL.
Score:0
vn flag

When I want to download a specific version of a package manually with wget, I use pkgs.org. This site basically have an index of all major repositories, and provide many package details.

It supports a solid handful of distros beside Ubuntu (you can find newer packages by installing from Debian unstable for instance), and both amd64 and arm64 architectures.

Here you can browse or search for any package, and you'll get the download link directly.

Take this example with Nano for Ubuntu 20.04.

You get a download link, a list of dependencies, list of files etc. To download this package manually, you just fire wget with the link provided:

wget http://archive.ubuntu.com/ubuntu/pool/main/n/nano/nano_4.8-1ubuntu1_amd64.deb

You can then proceed to do whatever you want with the package.

N0rbert avatar
zw flag
More trust is here - https://packages.ubuntu.com/focal/nano .
Artur Meinild avatar
vn flag
The download link is ultimately the same - but yes, it's of course a good idea to validate the link in more than one place.
user1094822 avatar
cn flag
[pkgs.org](https://pkgs.org/) looks great. is there a cli tool that can somewhat function like apt but rather fetches the packages from pkgs.org?
Score:0
zw flag

Manual package download will end with dependency hell on some another try.

This is why I have I have created special Docker-based script for my personal needs. It is located at https://github.com/N0rbert/deb-download .
Currently this script supports every Debian and Ubuntu versions which have docker base images on dockerhub, thus Ubuntu from 12.04 LTS, Debian from 6 and Mint from 18. Both EOL and actual releases are supported by script.

How to use:

  1. Know the needed Debian derivative name (like Debian itself, Ubuntu and Mint), its codename and the package name by using local tools like apt-cache policy, rmadison; or by visiting https://packages.debian.org , https://packages.ubuntu.com , http://packages.linuxmint.com , https://repology.org , https://pkgs.org , etc .

  2. Install Docker on the machine for example using docker.io package (package from docker.com will also work)

    sudo apt-get update
    sudo apt-get install docker.io git
    sudo usermod -a -G docker $USER
    

    and reboot machine.

  3. Clone the repository and run the script to get package(s) with its(their) dependencies

    cd ~/Downloads
    git clone https://github.com/N0rbert/deb-download.git
    cd deb-download
    chmod +x deb-download.sh
    
    #             derivative codename package(s)
    #                    ↓     ↓        ↓
    ./deb-download.sh ubuntu bionic zenmap
    
  4. Grab the downloaded deb-packages from storage sub-folder. Optionally grab the URL list file from storage/urls.txt.

  5. Carefully inspect the contents of storage subfolder, then try to install main deb-package to the target system, then fix its dependencies one-by-one.

    For example installation of ZenMap on Ubuntu 20.04 LTS system is possible by using below commands:

    cd storage
    sudo apt-get install ./zenmap_7.60-1ubuntu5_all.deb ./python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
    

More details are presented in README.md and in deb-download.sh script itself.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.