Contents

Setup Ubuntu 20.04 (apt, snap, flatpak)

Part of My Ubuntu 22.04 preferences.

apt: check diff (old-pc vs new-pc)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# on ssh-pc:
mkdir ~/logs/
ssh OLD_PC_IP apt list --installed > ~/logs/ubuntu_apt-list.old.txt
ssh NEW_PC_IP apt list --installed > ~/logs/ubuntu_apt-list.new.1.txt
# 20.04 focal
# 22.04 jammy
sed -E 's/focal/jammy/g' ~/logs/ubuntu_apt-list.old.txt   > ~/logs/ubuntu_apt-list.old.sed.txt
sed -E 's/\/.+$//g'      ~/logs/ubuntu_apt-list.old.txt   > ~/logs/ubuntu_apt-list.old.name-only.txt
sed -E 's/\/.+$//g'      ~/logs/ubuntu_apt-list.new.1.txt > ~/logs/ubuntu_apt-list.new.1.name-only.txt
# delta: https://github.com/dandavison/delta
delta ~/logs/ubuntu_apt-list.old.sed.txt       ~/logs/ubuntu_apt-list.new.1.txt
delta ~/logs/ubuntu_apt-list.old.name-only.txt ~/logs/ubuntu_apt-list.new.1.name-only.txt

apt: install

  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
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
rsync -av /etc/systemd/ /etc/systemd.orig/
sudo apt install tmux
tmux
bash

# [gui]     : don't install on Ubuntu server
# [systemd] : installs systemd unit file
#             echo > /tmp/apt_find_systemd_utils_done.txt
#             function find_systemd_units
#                 set -l PKG $argv[1]
#                 set_color green
#                 echo -n "$PKG"
#                 set_color normal
#                 grep -q $PKG /tmp/apt_find_systemd_utils_done.txt && echo ' skip' && return
#                 echo
#                 apt-file list $PKG | ag '/etc/init\.d|systemd'
#                 # TODO: recursive
#                 #   apt-cache depends --recurse nginx-extras  # too many...
#                 # TODO: asciidoctor -> <ruby:any>  # apt-file list '<ruby:any>'  # empty
#                 for pkg in (apt-cache depends $PKG | grep -P -o '(?<=^  Depends: ).+')
#                     echo -n "$PKG -> $pkg"
#                     grep -q $pkg /tmp/apt_find_systemd_utils_done.txt && echo ' skip' && continue
#                     echo
#                     apt-file list pkg | ag '^/etc/init\.d|systemd'
#                     echo "$pkg" >> /tmp/apt_find_systemd_utils_done.txt
#                 end
#                 echo "$PKG" >> /tmp/apt_find_systemd_utils_done.txt
#             end
#             find_systemd_units nginx-extras
#             find_systemd_units xl2tpd
#             #
#             ls -lrt /etc/init.d/
#             apt-file search /etc/init.d/nginx
#             ls -lrt --color /etc/systemd/system/ | tail -20
#             ls -lrt --color /etc/systemd/system/multi-user.target.wants | tail -20

apps=(
apt-file                          #
asciidoctor                       #
atop                              # [systemd] atop-rotate.service atop-rotate.timer atop.service atopacct.service
audacity                          # [gui]
autoconf                          #
automake                          #
autossh                           #
bear                              #
binutils                          #
binutils-arm-linux-gnueabi        #
binutils-arm-linux-gnueabihf      #
bison                             #
blender                           # [gui]
bmake                             #
bpfcc-tools                       #
bpftrace                          #
bridge-utils                      #
build-essential                   #
ccache                            #
cflow                             #
check                             #
chrome-gnome-shell                # [gui]
clang                             #
clang-format                      #
clang-tidy                        #
clang-tools                       #
clangd                            #
cloud-image-utils                 #
cloud-init                        #
cmake                             #
cmake-qt-gui                      # [gui] cmake-gui
compiz                            # [gui]
compizconfig-settings-manager     # [gui]
cowsay                            #
cppcheck                          #
cppcheck-gui                      # [gui]
crossbuild-essential-arm64        #
cscope                            #
csh                               #
cu                                #
curl                              #
cvs                               #
daemonize                         #
device-tree-compiler              # dtc
diffstat                          #
dnsutils                          #
doxygen                           #
duf                               #
dwarfdump                         #
dwarves                           # linux kernel config BTF
easystroke                        # [gui]
elfutils                          #
emacs                             #
entr                              #
ethtool                           #
expat                             #
expect                            #
fail2ban                          # fail2ban.service
faketime                          #
fasd                              #
ffmpeg                            #
flatpak                           # [systemd] flatpak-system-helper.service flatpak-oci-authenticator.service flatpak-portal.service flatpak-session-helper.service
flex                              #
fonts-ricty-diminished            # [gui]
g++                               #
gawk                              #
gcc                               #
gcc-arm-linux-gnueabi             #
gcc-arm-linux-gnueabihf           #
gcovr                             #
gdb-multiarch                     #
gdbserver                         #
gddrescue                         #
gettext                           #
gimp                              # [gui]
git                               #
git-cvs                           #
git-email                         #
git-lfs                           #
git-merge-changelog               #
git-svn                           #
gitk                              # [gui]
glibc-source                      #
gnome-tweaks                      # [gui]
gnulib                            #
gnumeric                          # [gui]
golang-go                         #
gpart                             # [gui]
gparted                           # [gui]
gperf                             #
gpick                             #
grabc                             # [gui]
graphviz                          #
groff                             #
gthumb                            # [gui]
htop                              #
hunspell                          #
hwinfo                            #
ibus-mozc                         # [gui]
iftop                             #
ike-scan                          #
inkscape                          # [gui]
inotify-tools                     #
iotop                             #
iperf                             #
iperf3                            #
jo                                #
jq                                #
kdiff3-qt                         # [gui] "kdiff3" has bug in pasting
ksh                               #
lame                              #
lcov                              #
ldap-utils                        #
ldnsutils                         #
libaio-dev                        #
libbind-dev                       #
libbluetooth-dev                  #
libboost-all-dev                  #
libbsd-dev                        #
libc-ares-dev                     #
libc++-dev                        #
libc6-dbg                         #
libcap-dev                        #
libcap-ng-dev                     #
libcap-ng-utils                   #
libclang-dev                      #
libcurl4-openssl-dev              #
libdbus-1-dev                     #
libdbus-glib-1-dev                #
libdvdnav4                        #
libdw-dev                         # dwarf
libdwarf-dev                      #
libedit-dev                       #
libelf-dev                        #
libev-dev                         #
libevent-dev                      #
libfuse-dev                       #
libgcrypt-dev                     #
libgtest-dev                      #
libimage-exiftool-perl            #
libmagic-dev                      #
libmpc-dev                        #
libncursesw5-dev                  #
libpcap-dev                       #
libreadline-dev                   #
libsmi2-dev                       #
libsource-highlight-dev           #
libsystemd-dev                    #
libtool                           #
libtool-bin                       #
libvirt-clients                   # [gui]
libvte-dev                        # [gui]
libwebkit2gtk-4.1-dev             # [gui]
libwireshark-dev                  # [gui]
libxtst-dev                       #
lld                               #
lldb                              #
llvm                              #
lnav                              #
ltrace                            #
mcomix                            # [gui]
mercurial                         #
meson                             #
minicom                           #
moreutils                         #
mosh                              #
musl                              #
musl-dev                          #
musl-tools                        #
net-tools                         #
ninja-build                       #
nkf                               #
nmap                              #
npm                               #
openssh-server                    # [systemd] rescue-ssh.target ssh.service ssh.socket ssh@.service
openssl                           #
pandoc                            #
peek                              # [gui]
perl                              #
php                               #
pinta                             # [gui]
pkg-config                        #
ppp                               #
ppp-dev                           #
pwgen                             #
pydf                              #
python-all-dev                    #
python3-all-dev                   #
python3-dbg                       #
python3-pip                       #
python3-venv                      #
qemu                              #
qemu-system-x86                   #
r-base-core                       #
readline-common                   #
recordmydesktop                   # [gui]
reptyr                            #
rr                                #
scons                             #
screen                            #
shellcheck                        #
silversearcher-ag                 #
smplayer                          # [gui]
sshfs                             #
subversion                        #
texinfo                           #
texlive                           #
tig                               #
tilix                             # [gui]
timidity                          #
tmux                              #
trash-cli                         #
tree                              #
uftrace                           #
unar                              # [gui]
unrar                             #
usbview                           # [gui]
valgrind                          #
vim-gtk                           # [gui]
vinagre                           #
virt-manager                      # [gui]
virtualbox                        #
virtualbox-guest-additions-iso    #
vlc                               # [gui]
wireshark-dev                     #
wmctrl                            #
xbindkeys                         # [gui]
xclip                             # [gui]
xdotool                           # [gui]
xsel                              # [gui]
zlib1g-dev                        #
zsh                               #
)

# not install
: <<'EOS'
# prompt apears and stops; install later

libdvd-pkg                        #
tshark                            #
ubuntu-restricted-extras          # [gui]
virtualbox-ext-pack               #
wireshark                         # [gui]

# don't install via apt; install according to the official website

adb                               #
docker-ce                         #
fish                              #

# unstable; maybe newer version exists; check manually

guile-2.2-dev                     #
guile-3.0-dev                     #
liblua5.4-0-dbg                   #
liblua5.4-dev                     #
libstdc++6-12-dbg                 #
libstdc++6-12-dbg-arm64-cross     #
libstdc++6-12-dbg-armhf-cross     #
lua5.4                            #
openjdk-18-dbg                    #
openjdk-18-doc                    #
openjdk-18-jdk                    #
openjdk-18-source                 #

# not frequently used

acct                              # [systemd] acct.service
aha                               #
android-sdk                       #
ant                               #
aqemu                             # [gui]
asunder                           # [gui]
at                                # [systemd] atd.service; replaced with systemd-run
composer                          # php
darktable                         # [gui]
ddd                               # [gui]
diodon                            # [gui] clipboard manager
exfat-fuse                        #
filezilla                         # [gui]
filter                            #
freeradius                        # [systemd] freeradius.service
ghc                               # haskell
git-flow                          #
gnome-shell-extensions-gpaste     # [gui]
gnome-software-plugin-flatpak     # https://flatpak.org/setup/Ubuntu/
gtick                             # [gui]
gtk-doc-tools                     #
hardinfo                          # [gui]
haskell-stack                     # haskell
help2man                          #
ifupdown                          # [systemd] ifup@.service ifupdown-pre.service ifupdown-wait-online.service networking.service
inetutils-telnetd                 #
intltool                          #
isc-dhcp-server                   # [systemd] isc-dhcp-server.service isc-dhcp-server6.service
ispell                            #
iwyu                              #
javacc                            #
kcachegrind                       # [gui]
kdialog                           # [gui]
keychain                          #
lirc                              # [systemd] irexec.service lircd-setup.service lircd-uinput.service lircd.service lircd.socket lircmd.service
lm-sensors                        # [systemd] lm-sensors.service
mininet                           #
mutt                              #
mysql-client                      #
nginx-extras                      # [systemd] nginx-common: /etc/init.d/nginx nginx.service
nodejs                            #
pavucontrol                       # [gui] https://askubuntu.com/a/229365/764025
pydf                              #
qtbase5-dev                       #
qtbase5-dev-tools                 #
qtmultimedia5-dev                 #
qttools5-dev                      #
qttools5-dev-tools                #
remake                            #
reportbug                         #
restic                            #
rubberband-cli                    #
samba                             # [systemd] /etc/init.d/nmbd /etc/init.d/samba-ad-dc /etc/init.d/smbd nmbd.service samba-ad-dc.service smbd.service
sbcl                              #
secure-delete                     #
setserial                         # [systemd] etc-setserial.service setserial.service
snmp                              #
snmp-mibs-downloader              #
snmpd                             # [systemd] snmpd.service
sparkleshare                      # [gui]
spell                             #
strongswan                        # [systemd] strongswan-starter: strongswan-starter.service
strongswan-pki                    #
sysstat                           # [systemd] sysstat-collect.service sysstat-collect.timer sysstat-summary.service sysstat-summary.timer sysstat.service
tcpreplay                         #
tftpd-hpa                         # [systemd] /etc/init.d/tftpd-hpa
thinkfan                          # [systemd] thinkfan-sleep.service thinkfan-wakeup.service thinkfan.service
tk                                #
tldr                              #
tlp                               # [systemd] tlp.service
tlp-rdw                           #
tp-smapi-dkms                     #
u-boot-tools                      #
uml-utilities                     # User-mode Linux
vlan                              #
vsftpd                            # [systemd] vsftpd.service
whois                             #
xl2tpd                            # [systemd] /etc/init.d/xl2tpd
xserver-xorg-dev                  # [gui]
xutils-dev                        #
EOS


# takes about 25min
sudo apt-get install -y "${apps[@]}"
#0 upgraded, 1927 newly installed, 0 to remove and 0 not upgraded.
#Need to get 3,022 MB/3,023 MB of archives.
#After this operation, 10.7 GB of additional disk space will be used.
# --install-suggests -> 3897 newly installed, 7,775 MB/7,847 MB, 24.7 GB

tail -c+0 -f /var/log/apt/term.log

# packages which need user interactions:
# TAB to switch choice
sudo apt install libdvd-pkg                # Configuring libdvd-pkg: Please run "sudo dpkg-reconfigure libdvd-pkg" to launch this process for the first time.  Enable automatic upgrades for libdvdcss2? Yes
sudo dpkg-reconfigure libdvd-pkg           # Download, build, and install libdvdcss2/1.4.3-1? Yes
sudo apt install tshark wireshark          # Configuring wireshark-common: Should non-superusers be able to capture packets? Yes
sudo apt install ubuntu-restricted-extras  # Configuring ttf-mscorefonts-installer:  Do you accept the EULA license terms?: Yes
sudo apt install virtualbox-ext-pack       # Configuring virtualbox-ext-pack: Do you accept the terms of the VirtualBox PUEL license?: Yes

# To reconfigure:
sudo dpkg-reconfigure libdvd-pkg
sudo dpkg-reconfigure wireshark-common
sudo dpkg-reconfigure virtualbox-ext-pack

# on ssh-pc:
__%pp:cut:begin__
ssh wsh79 apt list --installed > ~/logs/ubuntu_apt-list.new.2.txt
__%pp:cut:end__
ssh NEW_PC_IP apt list --installed > ~/logs/ubuntu_apt-list.new.2.txt
sed -E 's/\/.+$//g' ~/logs/ubuntu_apt-list.new.2.txt > ~/logs/ubuntu_apt-list.new.2.name-only.txt
delta ~/logs/ubuntu_apt-list.old.sed.txt     ~/logs/ubuntu_apt-list.new.2.txt
delta ~/logs/ubuntu_apt-list.old.name-only.txt ~/logs/ubuntu_apt-list.new.2.name-only.txt
delta /etc/systemd/  # check installed units

flatpak

https://flatpak.org/setup/Ubuntu/

1
2
3
4
5
6
7
sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
#==== AUTHENTICATING FOR org.freedesktop.Flatpak.configure-remote ====
#Authentication is required to configure software repositories
#Authenticating as: wsh,,, (wsh)
#Password: 
# enter system password

https://github.com/phw/peek

1
2
3
4
5
# old; now can be installed with apt-get

# flatpak install flathub com.uploadedlobster.peek
# # install password 8 times...
# # TODO: next time: try sudo flatpak install ...