Friday, April 26, 2024
17
rated 0 times [  17] [ 0]  / answers: 1 / hits: 13024  / 3 Years ago, wed, october 13, 2021, 10:10:56

I want to generate a package download list, which can be used to download those packages from another system. (I have a slow connection). I want to use those downloaded files to create a local repository from which I can install/upgrade my system.



How can I achieve this?


More From » installation

 Answers
0

First Note that, You must have the updated package indexes (these indexes are used by package management softwares to get information about the available packages online). So, you must download at least those index files.



To do so, open a terminal and give this command. (You must have a working internet connection for this step)



sudo apt-get update 


After you have the update package index files, use any of the method below:



Terminal way without synaptic



Use this command to generate an list of files needed to upgrade your system



sudo apt-get upgrade --allow-unauthenticated -y --print-uris | grep -o ''http.*' | tr "'" " " > download-list 


The file download-list will be created in the current folder of the terminal.



Or, If you want to generate a download script for a specific package, use this command (see the update section below for another command)



sudo apt-get install <package-name> --allow-unauthenticated -y --print-uris | grep -o ''http.*' | tr "'" " " > download-list


replace, <package-name> with actual name of the package. such as gtg for getting-things-gnome etc.



You can now use this file to feed any download manager which support input files with URLs.



For example to use this file with wget use this command below,



wget -c -i ./download-list


assuming download-list file is in the current directory of the terminal. The downloaded files will be stored in the current working directory of the terminal.



Update: I've found another command to generate package download list:



apt-get --allow-unauthenticated -y install --print-uris package-name | cut -d' -f2 | grep http:// > download-list


Credit of the updated command: answerer of this post






Graphical way using Synaptic



Synaptic package manager has built-in feature to generate package download script and you don't even need to to use wget explicitly in terminal, Only executing the script is sufficient.



The procedure is as follows




  1. Install Synaptic Package Manager using terminal:



     sudo apt-get update 
    sudo apt-get install synaptic


    (First command is not required, if you have updated package index files, If you are not sure, use both).


  2. Then open Synaptic Package Manager by Typing Synaptic in the dash.


  3. Select a package in the right section of the window, Right Click → Mark it for installation. Alternatively, If you want to generate an upgrade script, push the button Mark All Upgrades in the toolbar. The image below uses the second method.



    image of upgrade push button


  4. When asked if you want to Mark additional required chanages, press the Mark button.



    image of additional mark window


  5. Then going to File --> Generate package download script, save the script as a file by give it a name and select a directory where to save it. Now, You have a script for package downloads.




If you want to download, Go to the scripts directory and run sh ./<script-name>. For example, if the name of the script is download-list and it is in your Downloads folder, the command is



cd ~/Downloads && sh ./download-list

[#36568] Friday, October 15, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lintical

Total Points: 344
Total Questions: 122
Total Answers: 106

Location: Sint Maarten
Member since Mon, Oct 12, 2020
4 Years ago
lintical questions
Thu, Jan 12, 23, 03:07, 1 Year ago
Mon, Jun 28, 21, 07:01, 3 Years ago
Sat, Aug 7, 21, 04:29, 3 Years ago
Mon, Dec 5, 22, 00:03, 1 Year ago
;