Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 3282  / 2 Years ago, mon, april 18, 2022, 7:14:58

What apt incantations do I need to use to download the source packages for all the installed packages into a directory? (The use case is GPL compliance when giving an installed Ubuntu system to another person along with a computer.)


More From » apt

 Answers
3

Try this..



Create a directory where you want the source for all installed packages to be downloaded, and enter it.



mkdir source; cd source


Create a file named getsource.sh



getsource.sh



#!/bin/bash
dpkg --get-selections | while read line
do
package=`echo $line | awk '{print $1}'`
mkdir $package
cd $package
apt-get -q source $package
cd ..
done


Make it executable.



chmod a+x getsource.sh


Execute it..



./getsource.sh


And go grab a cup of coffee :)


[#39465] Tuesday, April 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rofity

Total Points: 182
Total Questions: 98
Total Answers: 115

Location: Albania
Member since Sat, Jan 7, 2023
1 Year ago
;