Skip to content

Commit ee6f362

Browse files
authored
docs: add how to setup dev env in ubuntu (#605)
1 parent 78d7df0 commit ee6f362

File tree

2 files changed

+75
-1
lines changed

2 files changed

+75
-1
lines changed

DEVELOPMENT.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
Deepkit uses NPM and Lerna to manage this monorepo. Local package linking is managed through the NPM Workspaces.
66

77
Make sure `libpq5` and `libpq-dev` are installed.
8-
These are needed for Postgres client `pg`, which is used in `@deepkit/postgres`.
8+
These are needed for Postgres client `pg`, which is used in `@deepkit/postgres`.\
9+
See [Ubuntu requirements setup](docs/setup-env-ubuntu.md) for detailed steps for an Ubuntu system.
910

1011
Node >= v20 is needed.
1112

docs/setup-env-ubundu.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
## Setup development environment in Ubuntu
2+
3+
### Step 1: Install `libpq5` and `libpq-dev`
4+
5+
1. **Update your package lists**:
6+
7+
Open a terminal and run:
8+
```bash
9+
sudo apt update
10+
```
11+
12+
2. **Install the packages**:
13+
14+
Run the following command to install `libpq5` and `libpq-dev`:
15+
```bash
16+
sudo apt install libpq5 libpq-dev
17+
```
18+
19+
### Step 2: Set Python to refer to Python 2
20+
21+
Since Python 2 is deprecated and might not be installed by default on newer systems, you'll need to ensure it is installed and set up correctly.
22+
23+
1. **Install Python 2**:
24+
25+
If Python 2 is not installed, you can install it using:
26+
```bash
27+
sudo apt install python2
28+
```
29+
30+
2. **Check if Python 2 is installed**:
31+
32+
Verify the installation by running:
33+
```bash
34+
python2 --version
35+
```
36+
37+
You should see something like:
38+
```
39+
Python 2.7.x
40+
```
41+
42+
3. **Update the `python` command to refer to Python 2**:
43+
44+
You might need to update the alternatives system to make `python` point to `python2`. Here’s how you can do that:
45+
46+
- **Check current alternatives**:
47+
```bash
48+
ls -l /usr/bin/python
49+
```
50+
51+
- **Set `python` to point to `python2`**:
52+
53+
If `/usr/bin/python` points to Python 3, you can update it using the alternatives system:
54+
55+
```bash
56+
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
57+
```
58+
59+
- **Verify**:
60+
61+
Check again to ensure that `python` now refers to Python 2:
62+
```bash
63+
python --version
64+
```
65+
66+
It should display:
67+
```
68+
Python 2.7.x
69+
```
70+
71+
### Step 3: Install Node
72+
73+
Refer to [node.js download](https://nodejs.org/en/download) for options on how to install node.

0 commit comments

Comments
 (0)