-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdump_installed_pkgs.sh
executable file
·61 lines (51 loc) · 1.29 KB
/
dump_installed_pkgs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
ts=$(date -u '+%Y%m%d-%H%M%S')
dstdir="pkgs_installed/$ts"
mkdir -p $dstdir
echo "dumping to folder: $dstdir"
#if [ -x "$(command -v apt)" ]; then
# dstfile="$dstdir/apt.txt"
# echo "writing: $dstfile"
# apt list --installed > $dstfile
#fi
if [ -x "$(command -v apt-mark)" ]; then
dstfile="$dstdir/apt-mark.txt"
echo "writing: $dstfile"
apt-mark showmanual > $dstfile
fi
if [ -x "$(command -v pip)" ]; then
dstfile="$dstdir/pip.txt"
echo "writing: $dstfile"
pip list > $dstfile
fi
# should we also do sudo pip
if [ -x "$(command -v brew)" ]; then
dstfile="$dstdir/brew.txt"
echo "writing: $dstfile"
brew list --versions > $dstfile
fi
if [ -x "$(command -v conda)" ]; then
dstfile="$dstdir/conda.txt"
echo "writing: $dstfile"
conda env export --name base > $dstfile
fi
if [ -x "$(command -v snap)" ]; then
dstfile="$dstdir/snap.txt"
echo "writing: $dstfile"
snap list > $dstfile
fi
if [ -x "$(command -v flatpak)" ]; then
dstfile="$dstdir/flatpak.txt"
echo "writing: $dstfile"
flatpak list > $dstfile
fi
if [ -x "$(command -v nix-env)" ]; then
dstfile="$dstdir/nix-env.txt"
echo "writing: $dstfile"
sudo nix-env -qa --installed "*" > $dstfile
fi
if [ -x "$(command -v cargo)" ]; then
dstfile="$dstdir/cargo.txt"
echo "writing: $dstfile"
cargo install --list > $dstfile
fi