-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME.qmd
809 lines (582 loc) · 28.4 KB
/
README.qmd
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
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
---
format: gfm
eval: false
toc: true
title: Install tools for geocomputation, research and fun on Ubuntu
---
Inspired by a post on [installing commonly needed GIS software on Ubuntu](https://medium.com/@ramiroaznar/how-to-install-the-most-common-open-source-gis-applications-on-ubuntu-dbe9d612347b) and having recently got a new computer (an Entroware Proteus, a bit faster than the second hand [Lenovo laptop](http://www.ebay.co.uk/sch/PC-Laptops-Netbooks/177/i.html?_from=R40&_nkw=lenovo&_dcat=177&rt=nc&_mPrRngCbx=1&_udlo=0&_udhi=200) I was running when I created this repo!) with Ubuntu freshly installed, I decided to make the process of installing GIS software on it as reproducible as possible.
After installing this software your computer may look a bit like this:
![](vscode-qgis-editing.png)
Clutter for demo purposes!
This is not intended to replace the excellent [OSGeo Live distro](https://live.osgeo.org/en/index.html), which contains a ton of amazing geo packages.
Instead it's for people who want lean, core GIS functionality on their existing Ubuntu machine, with a focus on geocomputation and data science.
Rather than providing automated scripts, it simply provides the bash commands here in the README for you to copy, paste (or Ctrl+Shift+Enter if in RStudio if you download this README, a great shortcut)
Core programs it shows how to install are:
- GitHub's CLI tool for command-line collaboration and code sharing
- **R** with access to pre-compiled packages, a powerhouse for statistical computing
- R packages for working with spatial data
- **RStudio**, a space-aged editor for **R**
- VS Code with extensions for R, Python, C/C++, Rust, Docker, and more
- Docker, which gives ultimate power and flexibility to install and run software
- **QGIS**, probably the most popular GUI-driven GIS in the world
- Recent versions of **GDAL** and **GEOS** C/C++ libraries
- Python packages for Geographic Data Science
- Rust, an upcoming systems language with impressive geo libs
All this can be a pain to install manually.
The commands below are designed to make your life easier.
Any comments/suggestions: welcome
## Prerequisites
- A working installation of Ubuntu 22.04, 'Jammy Jellyfish' on a computer you have access to
# Install key packages
Fire up a terminal, e.g. with `Ctl-Alt-T` after booting Ubuntu, then enter the following.
## GitHub's gh CLI
GitHub has developed a command line interface (CLI) tool for enabling fast and intuitive interaction with the world's premier code hosting platform.
It's a good place to start because it's small, self-contained, and can be used to clone code repos like this one.
Install it with the following cryptic commands from the project's [GitHub page](https://github.com/cli/cli/blob/trunk/docs/install_linux.md):
```{bash}
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
```
Test to see if it works as follows:
```{bash}
# Log-in to GitHub from the command line
gh auth login
gh repo clone Robinlovelace/install-geocomp-ubuntu
cd install-geocomp-ubuntu
less README.md
```
You may also want to update your Git version, which is installed by default on Ubuntu:
```{bash}
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git
```
Previously I was on Git 2.25.1, now I'm on 2.40.0:
```{bash}
#| eval: true
git --version
```
### Setting up Git
Setup git with the following commands
```{bash}
git config --global user.email "[email protected]"
git config --global user.name "trachelium"
# Set the default branch to main:
git config --global init.defaultBranch main
```
### dra
```{bash}
```{bash}
wget $(curl -s https://api.github.com/repos/devmatteini/dra/releases/latest | grep "browser_download_url.*amd64.deb" | cut -d '"' -f 4) -O /tmp/dra.deb
sudo dpkg -i /tmp/dra.deb
```
That allows you to download assets with commands such as:
```bash
# Automatically select and download an asset based on your operating system and architecture
# you can use -a or --automatic
dra download -a devmatteini/dra-tests
```
## R and RStudio
I have become a huge fan of VS Code and installing it plus some amazing extensions is covered in the next section.
VS Code is increasingly good with decent support for visualisations and, as the screenshot below shows, even now marks-up markdown outputs from Quarto documents.
However, if you want to do standard data science things and create reproducible documents, R+RStudio is hard to beat, especially if you're just starting out with data science.
Install them with the following commands:
These instructions were adapted from https://rtask.thinkr.fr/installation-of-r-4-2-on-ubuntu-22-04-lts-and-tips-for-spatial-packages/
```{bash}
sudo apt update
sudo apt upgrade
sudo apt install -y --no-install-recommends software-properties-common dirmngr
# Add the keys
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
# You'll be asked to choose your geographical area
sudo apt install -y r-base r-base-core r-recommended r-base-dev
# Install PPA with pre-compiled packages
sudo add-apt-repository ppa:c2d4u.team/c2d4u4.0+
```
### Rapid install of R packages
A difference between R packages on Windows and Ubuntu is that by default Windows always installs binary versions of packages, meaning no compilation time.
To speed-up installation of R packages you can add an Ubuntu repo that will allow you to install pre-compiled packages from the system command line.
Although there are projects like [r2u](https://github.com/eddelbuettel/r2u) that give you binary packages with `install.packages()` I prefer the control of using the system command line for binaries and the R console for installing packages that want to be compiled, to avoid issues like this: https://github.com/rocker-org/rocker-versioned2/issues/631
Get a load of great R packages with the following commands:
```{bash}
# My own selection among 5000...
sudo apt install -y r-cran-rgl r-cran-rjags r-cran-snow r-cran-ggplot2 r-cran-igraph r-cran-lme4 r-cran-rjava r-cran-devtools r-cran-roxygen2 r-cran-rjava
sudo apt install r-cran-tidyverse
sudo apt install r-cran-sf r-cran-tmap r-cran-osmextract r-cran-mapview
# System deps for cartography
sudo apt install -y libgdal-dev libproj-dev libgeos-dev libudunits2-dev libv8-dev libnode-dev libcairo2-dev libnetcdf-dev
sudo apt install -y libglu1-mesa-dev freeglut3-dev mesa-common-dev
# Extra packages for image manipulation
sudo apt install -y libmagick++-dev libjq-dev libv8-dev libprotobuf-dev protobuf-compiler libsodium-dev imagemagick libgit2-dev
# rspatial
sudo apt install r-cran-sf r-cran-terra r-cran-mapedit r-cran-tmap r-cran-mapdeck r-cran-shinyjs
Rscript -e 'install.packages("languageserver")'
```
RStudio: https://www.entroware.com/store/proteus
```{bash}
wget https://download1.rstudio.org/electron/jammy/amd64/rstudio-2023.03.0-386-amd64.deb
sudo dpkg -i rstudio*
rm -v rstudio*
```
After installing RStudio you can open it by pressing the 'Windows button' and they typing RStudio.
You should also be able to open it with the following command in the terminal:
```{bash}
rstudio
```
After opening RStudio you can open the folder containing these instructions, or any folder, with the following command typed into the R console.
```{r, eval=FALSE}
rstudioapi::openProject("~/Download/install-geocomp-ubuntu/")
```
Also in RStudio you can commit and push changes to this or any repo as follows, starting by opening a terminal by clicking on the Terminal button or by typing the shortcut: `Alt+Shift+M`.
You can also execute lines of code from the source editor in RStudio in the terminal by typing `Ctrl+Alt+Enter`, which will send the current line of code to the terminal.
```{bash}
git status
git commit -am 'Update instructions with info on using RStudio'
```
## VS Code
VS Code is a versatile and future-proof IDE.
```{bash}
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
rm packages.microsoft.gpg
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
sudo apt update
sudo apt-get install code
code --install-extension ms-vscode-remote.remote-containers
# Install the Python extension:
code --install-extension ms-python.python
# Remote containers:
code --install-extension ms-vscode-remote.remote-containers
# Install ritwickdey.LiveServer:
code --install-extension ritwickdey.LiveServer
```
### Positron: a VS Code-compatible IDS
Get the latest pre-release with:
```{bash}
# Manually:
# wget https://github.com/posit-dev/positron/releases/download/2025.01.0-39/Positron-2025.01.0-39.deb -O /tmp/positron.deb
# sudo dpkg -i /tmp/positron.deb
# Automatically:
# Find latest release:
curl https://github.com/posit-dev/positron/releases | grep "positron/releases/tag" | grep -oP '(?<=tag/)[^"]+' | head -n 1 | xargs -I {} wget https://github.com/posit-dev/positron/releases/download/{}/Positron-2025.01.0-39.deb -O /tmp/positron.deb
sudo dpkg -i /tmp/positron.deb
```
### Executing bash commands in VS Code
A great feature of VS Code is that you can execute bash commands in the integrated terminal.
Open the integrated terminal by typing the shortcut: `Ctrl+J`.
Open a new terminal in VS code by typing the shortcut: `Ctrl+backtick`(`).
Executing code is made even easier by the Quarto extension for VS Code, which can be installed as follows from bash:
```{bash}
code --install-extension quarto.quarto
```
After that extension has been installed you should be able to execute code in the integrated terminal by typing `Ctrl+Enter` in the source editor, as shown in the following screenshot:
![](run-cells.png)
### Installing key VS Code extensions
```{bash}
code --install-extension reditorsupport.r
code --install-extension github.copilot
```
### Creating documents with Quarto
Install the Quarto command line tool:
```{bash}
wget $(curl -s https://api.github.com/repos/quarto-dev/quarto-cli/releases/latest | grep "browser_download_url.*linux-amd64.deb" | cut -d '"' -f 4) -O /tmp/quarto.deb
sudo dpkg -i /tmp/quarto.deb
```
Install the Quarto R package:
```{bash}
Rscript -e "remotes::install_github('quarto-dev/quarto-r')"
```
VS Code has a nice feature that enables you to develop inside a 'devcontainer'.
Devcontainers rely on Docker, which can be installed as follows:
## Docker
Docker is a system platform that allows you to run applications in isolated environments called containers.
Containers are similar to virtual machines, but they are more lightweight and efficient.
Docker allows you to run applications in a sandboxed environment, which is useful for reproducibility and security.
In essence: run anything, anywhere.
Following instructions from https://docs.docker.com/engine/install/ubuntu/, first install the dependencies:
```{bash}
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
```
Then follow these commands:
```{bash}
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Use the following command to set up the repository:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine
# Update the apt package index, and install the latest version of Docker Engine, containerd, and Docker Compose, or go to the next step to install a specific version:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
```
### Post installation steps for Docker
The following steps enable you to run docker without `sudo`.
As outlined at https://docs.docker.com/engine/install/linux-postinstall/ this does have security implications so it may be unwise to run these commands on important production servers or critical infrastructure.
For a personal laptop that does not contain sensitive information the risks are low.
```{bash}
sudo groupadd docker
# Add your user to the docker group:
sudo usermod -aG docker $USER
# Log out and log back in so that your group membership is re-evaluated.
# If you’re running Linux in a virtual machine, it may be necessary to restart the virtual machine for changes to take effect.
# You can also run the following command to activate the changes to groups:
newgrp docker
# Verify that you can run docker commands without sudo.
docker run hello-world
# If you initially ran Docker CLI commands using sudo before adding your user to the docker group, you may see the following error:
# WARNING: Error loading config file: /home/user/.docker/config.json -
# stat /home/user/.docker/config.json: permission denied
# This error indicates that the permission settings for the ~/.docker/ directory are incorrect, due to having used the sudo command earlier.
# To fix this problem, either remove the ~/.docker/ directory (it’s recreated automatically, but any custom settings are lost), or change its ownership and permissions using the following commands:
sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
sudo chmod g+rwx "$HOME/.docker" -R
```
### Running devcontainer with VS code
To check your `code` and `docker` installations worked you can try to reproduce Geocomputation with Python:
```{bash}
gh repo clone geocompx/geocompy
code geocompy
```
If you installed the `remote-containers` extension successfully, you should see a button with "Reopen in Container" in the bottom right of VS Code.
Click that button and you'll see the devcontainer launch.
If it works, you can try reproducing the entirety of the book from the command line with the following inside VS Code (you can launch the terminal by pressing Ctrl+J`):
```{bash}
quarto preview
```
If you see something like this, congratulations, you can develop almost anything in reproducible and easy-to-use devcontainers!
![](vscode-devcontainer.png)
### Running a docker container
The following launches a docker container with JupyterLab:
```{bash}
docker run -it --rm \
-p 8888:8888 \
-u root \
-v "${PWD}/jupyterlab-jovyan":/home/jovyan \
-e NB_UID=$(id -u) \
-e NB_GID=$(id -g) \
-e CHOWN_HOME=yes \
-e CHOWN_HOME_OPTS='-R' \
glcr.b-data.ch/jupyterlab/r/geospatial
```
## QGIS
From: https://github.com/geocompx/docker/blob/master/qgis/Dockerfile
```{bash}
# To use the qgis archive you have to first add the archive’s repository public key:
wget https://download.qgis.org/downloads/qgis-archive-keyring.gpg
gpg --no-default-keyring --keyring ./qgis-archive-keyring.gpg --list-keys
# After you have verified the output you can install the key with:
sudo mkdir -m755 -p /etc/apt/keyrings # not needed since apt version 2.4.0 like Debian 12 and Ubuntu 22 or newer
sudo cp qgis-archive-keyring.gpg /etc/apt/keyrings/qgis-archive-keyring.gpg
# Alternatively you can download the key directly without manual verification:
# Types: deb deb-src
# URIs: *repository*
# Suites: *codename*
# Architectures: amd64
# Components: main
# Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg
# With the keyring in place you can add the repository as /etc/apt/sources.list.d/qgis.sources with following content:
# Types: deb deb-src
# URIs: https://qgis.org/ubuntu-ltr
# Suites: jammy
# Architectures: amd64
# Components: main
# Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg
sudo vim /etc/apt/sources.list.d/qgis.sources
# After that type the commands below to install QGIS:
sudo apt update
sudo apt install qgis qgis-plugin-grass
# In case you would like to install QGIS Server, type:
sudo apt install qgis-server --no-install-recommends --no-install-suggests
# if you want to install server Python plugins
sudo apt install python3-qgis
sudo apt-get update
sudo apt-get -y --with-new-pkgs upgrade && \
sudo apt-get -y autoremove && \
sudo apt-get -y install qgis qgis-plugin-grass saga
# for how to use the qgis-plugin-manager, see https://github.com/3liz/qgis-plugin-manager
pip3 install qgis-plugin-manager
# to enable the qgis-plugin-manager, add the corresponding path to PATH
# ENV PATH="/home/rstudio/.local/bin:$PATH"
echo "export PATH=\"/home/rstudio/.local/bin:\$PATH\"" >> /etc/profile
# from the next line onwards we have trouble with the rstudio server, therefore we switch to the rstudio user
mkdir -p /home/rstudio/.local/share/QGIS/QGIS3/profiles/default/python/plugins
ENV QGIS_PLUGINPATH=/home/rstudio/.local/share/QGIS/QGIS3/profiles/default/python/plugins
echo 'export QGIS_PLUGINPATH=/home/rstudio/.local/share/QGIS/QGIS3/profiles/default/python/plugins' >> /etc/profile
less /etc/profile
exit
qgis-plugin-manager init
qgis-plugin-manager update
# install SAGA next generation plugin
qgis-plugin-manager install 'Processing Saga NextGen Provider'
Rscript -e "install.packages('remotes')"
Rscript -e "remotes::install_github('r-spatial/qgisprocess')"
```
## Rust
```{bash}
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Make Rust available:
source "$HOME/.cargo/env"
# Try installing a crate:
cargo install geo
cargo install geozero
cargo install zonebuilder
```
# Getting started with tools for geocomputation
Once you have the software installed, you can run it as follows:
- For QGIS, you can launch it with the usual launcher or from the command line
```
qgis # run QGIS
```
See the [QGIS manual](https://docs.qgis.org/latest/en/docs/index.html)
- For R, you can run R from the bash shell by entering `R`. For beginners, RStudio is recommended, which can be opened from the Ubuntu Dash launcher or from bash with:
```
rstudio
```
# Other tools for boosting productivity and developer experience
## Rust command-line utilities
These are some fast and versatile command-line utilities that provide an alternitive to standard Unix tools.
### ripgrep
ripgrep is a line-oriented search tool that recursively searches your current directory for a regex pattern. It is similar to other popular search tools like The Silver Searcher, ack, and grep.
```{bash}
sudo apt install ripgrep
rg --help
```
### fd
fd is a simple, fast and user-friendly alternative to find.
```{bash}
sudo apt install fd-find
fdfind --help
```
### sd
[sd](https://github.com/chmln/sd) is a find & replace CLI (command-line interface) tool that allows you to perform simple find & replace operations on files.
```{bash}
cargo install sd
sd --help
```
### exa
exa is a modern replacement for ls. It supports colors, file icons, git integration, and more.
```{bash}
cargo install exa
exa .
```
### dust
dust is a more intuitive version of du in rust. It provides a better way to navigate through your system and view disk usage.
```{bash}
cargo install du-dust
dust --help
```
### ripgrep_all
ripgrep_all is a tool that combines the power of ripgrep for all file formats.
```{bash}
apt install build-essential pandoc poppler-utils ffmpeg ripgrep cargo
cargo install --locked ripgrep_all
```
## CopyQ
```{bash}
sudo add-apt-repository ppa:hluk/copyq
```
This command adds the PPA maintained by the CopyQ developer Lukas Holecek to your system's software sources. You'll be prompted to enter your password to confirm the command.
Update the package list by running the following command:
```{bash}
sudo apt update
```
Install CopyQ by running the following command:
```{bash}
sudo apt install copyq
```
This command installs the latest version of CopyQ and its dependencies on your system.
Once the installation is complete, you can launch CopyQ by typing copyq in the terminal or by searching for it in the Applications menu.
## AppImage Launcher
Intuitive and time-saving management of AppImages.
```{bash}
sudo add-apt-repository ppa:appimagelauncher-team/stable
sudo apt update
sudo apt install appimagelauncher
```
## LogSeq
LogSeq is an application for storing notes, todo lists, and more.
To install it just click on the latest '.AppImage' file in the latest releases, download it, and it should be integrated by AppImage Launcher: https://github.com/logseq/logseq/releases
## Zotero
```{bash}
wget -O zotero.tar.bz2 'https://www.zotero.org/download/client/dl?channel=release&platform=linux-x86_64'
tar -xjf zotero.tar.bz2 -C ~/Downloads/
sudo mv ~/Downloads/Zotero_linux-x86_64 /opt/Zotero
sudo ln -s /opt/Zotero/zotero /usr/local/bin/
sudo apt-get install libdbus-glib-1-2 libgtk-3-0 libxt6 libxrender1 libx11-xcb1
```
Run Zotero with:
```{bash}
zotero
```
### Make Zotero available to the launcher
```{bash}
cd /usr/share/applications
sudo bash -c 'echo "[Desktop Entry]
Version=1.0
Name=Zotero
GenericName=Reference Manager
Comment=Zotero Reference Manager
Exec=/opt/Zotero/zotero %U
Terminal=false
Type=Application
Icon=/opt/Zotero/chrome/icons/default/default256.png
Categories=Office;" > zotero.desktop'
sudo chmod +x zotero.desktop
cd -
```
## ddterm
ddterm is top down terminal: https://github.com/ddterm/gnome-shell-extension-ddterm
I have long been a fan of [Guake](https://github.com/Guake/guake/), the popular terminal emulator based roughly on Quake's top down terminal.
Unfortunately, Guake does not have great support for Wayland, Ubuntu 22.04's display system, as discussed in this issue that is still open despite being a priority that was opened in 2015: https://github.com/Guake/guake/issues/492
Install it as follows:
```{bash}
cd ~/Downloads/
wget https://github.com/ddterm/gnome-shell-extension-ddterm/releases/download/v43/[email protected]
gnome-extensions install -f ~/Downloads/[email protected]
sudo reboot # you may need to reboot the computer to use it
gnome-extensions enable [email protected]
```
## Signal
Signal is an app for messaging and more.
```{bash}
# NOTE: These instructions only work for 64 bit Debian-based
# Linux distributions such as Ubuntu, Mint etc.
# 1. Install our official public software signing key
wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg
cat signal-desktop-keyring.gpg | sudo tee -a /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null
# 2. Add our repository to your list of repositories
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |\
sudo tee -a /etc/apt/sources.list.d/signal-xenial.list
# 3. Update your package database and install signal
sudo apt update && sudo apt install signal-desktop
```
## Flameshot
Flameshot is a powerful yet simple to use screenshot software.
```{bash}
sudo apt install flameshot
```
## Chrome
```{bash}
# Add the Google Chrome repository to your system
echo "Adding Google Chrome repository..."
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
# Update your package list
echo "Updating package list..."
sudo apt-get update
# Install Google Chrome
echo "Installing Google Chrome..."
sudo apt-get install google-chrome-stable -y
echo "Google Chrome installation complete."
```
## Edge
```{bash}
# Add the Microsoft Edge repository to your system
echo "Adding Microsoft Edge repository..."
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo install -o root -g root -m 644 microsoft.asc.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
rm microsoft.asc.gpg
# Update your package list
echo "Updating package list..."
sudo apt-get update
# Install Microsoft Edge
echo "Installing Microsoft Edge..."
sudo apt-get install microsoft-edge-dev -y
echo "Microsoft Edge installation complete."
```
## KmCaster
```{bash}
sudo apt install openjdk-19-jdk
mkdir ~/programs
wget https://github.com/DaveJarvis/kmcaster/releases/latest/download/kmcaster.jar -O ~/programs/kmcaster.jar
java -jar ~/programs/kmcaster.jar -h
java -jar ~/programs/kmcaster.jar -d 70
```
## Syncthing
Syncthing is a great way to synchronize laptops, phones and other devices. I use it for syncing photos onto my laptop and into family photo albums, as shown below.
![](syncthing.png)
```{bash}
# Add Syncthing repository key
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
# Add Syncthing repository to system sources
echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
# Update system package cache
sudo apt-get update
# Install Syncthing package
sudo apt-get install syncthing -y
# Start the Syncthing service and enable it to run at system boot time
syncthing
# Output installation completed message
echo "Syncthing installation completed successfully!"
```
## Rclone
`rclone` is a tool for copying and syncing files between computers. It offers several advantages over rsync, including:
1. Support for more cloud storage providers: Rclone supports a wide range of cloud storage providers, including Dropbox, Google Drive, Amazon S3, Microsoft OneDrive, Box, among others. In contrast, rsync only supports local, networked, or remote file transfer.
2. Encryption and compression: Rclone supports several encryption methods and compression algorithms to secure and reduce the size of data during transfer. Rsynd doesn't have native support for encryption and compression.
3. Synchronization: Rclone has a built-in synchronization tool that allows you to keep your files and directories in sync across different storage locations. While rsync can be used for synchronization, it requires a bit more setup and configuration.
4. Multi-threaded transfers: Rclone can upload and download files using multiple threads simultaneously, which can significantly speed up the transfer process. Rsynce is limited to single-threaded transfers.
5. Cross-platform compatibility: Rclone is a cross-platform tool that can be run on Windows, Linux, macOS, and other operating systems. Rsync, on the other hand, is primarily a Unix-based tool and may require additional setup on non-Unix systems.
Install it with:
```bash
sudo apt install rclone
```
## Peak
Install the screenshare-to-GIF tool Peak with the following commands on Ubuntu:
```{bash}
# Install simple screen recorder on ubuntu:
sudo apt install simplescreenrecorder
```
## Discord
Download discord from https://discord.com/download and install it with:
```{bash}
sudo apt install libgconf-2-4 libc++1
sudo dpkg -i discord.deb
```
## Slack
```{bash}
sudo snap install slack --classic
```
## OneDrive
https://github.com/abraunegg/onedrive/blob/master/docs/ubuntu-package-install.md
```{bash}
rm -rf /var/lib/dpkg/lock-frontend
rm -rf /var/lib/dpkg/lock
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get autoremove -y
apt-get autoclean -y
```
https://github.com/abraunegg/onedrive/blob/master/docs/ubuntu-package-install.md#distribution-ubuntu-2204
```{bash}
wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_22.04/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_22.04/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list
sudo apt-get update
# Step 4: Install 'onedrive'
# Run:
sudo apt install --no-install-recommends --no-install-suggests onedrive
```
## OnlyOffice
```{bash}
sudo apt install gdebi
wget https://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_amd64.deb
sudo dpkg -i onlyoffice-desktopeditors_amd64.deb
```
## Move your home directory to a separate partition
It's good practice to keep your home directory on a separate partition.
See [here](https://www.howtogeek.com/442101/how-to-move-your-linux-home-directory-to-another-hard-drive/) for instructions on how to do that.
# Alternative projects
- [ubuntu-post-install](https://github.com/snwh/ubuntu-post-install)
- [install-tl-ubuntu](https://github.com/scottkosty/install-tl-ubuntu)