Skip to content

Commit 4b38cda

Browse files
authored
Merge pull request #43 from fire2a/update-wsl-install
wsl settings and apt.list & sources
2 parents 7f86f26 + 27989d4 commit 4b38cda

4 files changed

Lines changed: 48 additions & 21 deletions

File tree

58.9 KB
Loading
59.9 KB
Loading
83.7 KB
Loading

site/qgis-management/install.md

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ At the time of writing we support 3.36.2 and up.
3333
- Official QGIS [install tutorial](https://qgis.org/download/)
3434
- Make a system aware python virtual environment for QGIS:
3535
```bash
36-
# required
36+
# required to create venvs
3737
sudo apt install python3-venv
3838

39-
# ~/pyvenv/qgis is just an example
4039
python3 -m venv --system-site-packages ~/pyvenv/qgis
40+
# ~/pyvenv/qgis is just an example, used from now onwards
41+
# the --system-site-packages flag allows the usage of GDAL, PyQt5, SIP and other QGIS dependencies
4142
```
4243
- Usage: activate before launching qgis
4344
```bash
@@ -52,8 +53,8 @@ At the time of writing we support 3.36.2 and up.
5253
5354
# edit the sections in
5455
nano ~/.local/share/applications/org.qgis.qgisvenv.desktop
55-
# rename the launcher
56-
Name=QGIS Desktop (venv)
56+
# rename the launcher (as you wish)
57+
Name=fire2a QGIS Desktop
5758
5859
# activate the python environment
5960
Exec=bash -c 'source ~/pyvenv/qgis/bin/activate && qgis %F'
@@ -88,41 +89,67 @@ Some algorithms (DPV) don't parallelize in Windows; the standalone installer doe
8889
Official [guide](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps), nevertheless here are the main steps for setting up Debian with QGIS:
8990
- Prerequisites: Windows 10 Build 19044+ or Windows 11 (for WSL2 with GUI)
9091

91-
1. Virtualization must be enabled (usually is, but restart to bios or uefi setup and check, else the next step will fail)
92+
1. Virtualization must be enabled (usually is, but restart to bios or uefi to setup and check, else the next step will fail)
9293
2. Activate the Windows Subsystem for Linux (WSL) additional feature (Start > Search > `Turn Windows features on or off` > checkbox `Windows Subsystem for Linux`, needs restarting)
93-
3. Install Debian Linux distribution from the Microsoft Store or type in PowerShell
94+
3. On the WSL Settings App, make sure `gui apps` is enabled and, if needed, set maximum shared space less than the 1TB default
95+
96+
| <img src="img/wsl_settings_about.png" alt='wsl settings about' style="width: 60%"> |
97+
| <img src="img/wsl_settings_gui.png" alt='wsl settings gui' style="width: 60%"> |
98+
| <img src="img/wsl_settings_fs_size.png" alt='wsl settings filesystem size' style="width: 60%"> |
99+
100+
4. Install Debian (more reliable than Ubuntu) Linux distribution from the Microsoft Store or type in PowerShell
94101
```powershell
95102
wsl --install -d Debian
96103
```
97-
4. Install the graphic drivers for gui apps (Open Debian from the Start menu)
104+
5. Install the graphic drivers for gui apps (Open Debian from the Start menu) Also there's an Ubuntu variant, read below!
98105
```bash
99-
# update and upgrade the system (tip: repeat monthly)
106+
# Update and upgrade the system (tip: repeat monthly)
100107
sudo apt update && sudo apt upgrade -y
101108
102-
# install the graphic drivers by allowing firmware packages
103-
sudo nano /etc/apt/sources.list
109+
# Install the graphic drivers by allowing all firmware packages, editing the sources file:
110+
sudo nano /etc/apt/sources.list.d/debian.sources
104111
105-
# add contrib, non-free and non-free-firmware to the end of the lines (3 or 4 lines), like this:
106-
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
112+
# Add 'contrib', 'non-free' and 'non-free-firmware' to the 'Component' section
113+
# of the trixie and trixie-update suites, e.g., change:
114+
Types: deb
115+
URIs: https://deb.debian.org/debian
116+
Suites: trixie trixie-updates
117+
Components: main contrib non-free non-free-firmware # <-- ADD HERE
118+
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
107119
108-
# save and exit the editor: Ctrl+O, Enter, Ctrl+X
120+
# to save and exit the nano editor: Ctrl+O, Enter, Ctrl+X
109121
110-
# update and install the drivers
122+
# Update and install the drivers
111123
sudo apt update && sudo apt install firmware-linux firmware-linux-nonfree -y
112124
sudo reboot
113125
114-
# test the drivers
126+
# Test the drivers
115127
sudo apt install x11-apps
116128
xeyes
117129
```
130+
5.U If using Ubuntu or older debian versions, they use the older apt sources list formats
131+
```bash
132+
sudo nano /etc/apt/sources.list
133+
# append at the end of the lines
134+
135+
# for older Debian Bookworm
136+
# add 'contrib', 'non-free' and 'non-free-firmware'
137+
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
138+
139+
# for Ubuntu
140+
# add 'restricted', 'universe', 'multiverse'
141+
deb http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
142+
```
118143
119-
5. Check this [tutorial](https://learn.microsoft.com/en-us/windows/wsl/filesystems?source=recommendations), tl;dr:
144+
6. Check this [tutorial](https://learn.microsoft.com/en-us/windows/wsl/filesystems?source=recommendations), tl;dr:
120145
- _Linux programs should work over linux locations, mixing windows locations is slow_
121146
- linux path `/home/<user name>` is equivalent to `\\wsl$\debian\home\<user name>` in windows
122147
- `/mnt/c/Users/<user name>/` is equivalent to `C:\Users\<user name>\`
123148
- use the `explorer.exe .` command to open a file explorer in the current directory
124-
6. Now you can install QGIS as in the linux section
125-
7. Windows icon to launch QGIS: Create a batch file, e.g., `Desktop\launch_qgis.bat` with the following content:
149+
150+
7. Now you can install QGIS as in the [linux section](./install.html#linux-)
151+
152+
8. Windows icon to launch QGIS: Create a batch file, e.g., `Desktop\launch_qgis.bat` with the following content:
126153
```batch
127154
@echo off
128155
wsl -d Debian -- bash -c "source ~/pyvenv/qgis/bin/activate && qgis"
@@ -134,7 +161,7 @@ Official [guide](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-app
134161
## OSGeo4W installer
135162
- Official [OSGeo4W installer](https://qgis.org/resources/installation-guide/#osgeo4w-installer) guide
136163
- QGIS gets installed in `C:\OSGeo4W\bin\qgis-bin.exe`
137-
- To use QGIS's python you must open the OSGeo4W shell and activate the environment
164+
- To use QGIS's python you must open the OSGeo4W shell and activate the environment, this is the wrapper:
138165
```batch
139166
C:\OSGeo4W> cd bin
140167
C:\OSGeo4W\bin> python-qgis.bat
@@ -145,8 +172,8 @@ Official [guide](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-app
145172

146173
## Standalone installer
147174
- Official QGIS [standalone](https://qgis.org/resources/installation-guide/#standalone-installers) guide
148-
- QGIS gets installed in `C:\Program Files\QGIS 3.40.2\bin\qgis-bin.exe`
149-
- To use QGIS's python you must open the OSGeo4W shell and activate the environment
175+
- QGIS gets installed in `C:\Program Files\QGIS 3.40.2\bin\qgis-bin.exe`. The downside is that the version varies with every update, needing full reinstallation (use OSGeo4W if you want quick auto updates and no path changes)
176+
- To use QGIS's python you must open the OSGeo4W shell and activate the environment, this is the wrapper:
150177
```batch
151178
C:\Program Files\QGIS 3.40.2\> cd bin
152179
C:\Program Files\QGIS 3.40.2\bin\> python-qgis.bat

0 commit comments

Comments
 (0)