> For the complete documentation index, see [llms.txt](https://agstakingco.gitbook.io/eth-updates-april-12-2023/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agstakingco.gitbook.io/eth-updates-april-12-2023/bash-script.md).

# Bash Script

You can create a basic Bash script to update Geth / Lighthouse

This script is for `geth v1.11.15` and `lighthouse v4.0.1`

**1) Open a new document in "Text Editor"**

{% hint style="info" %}
You can launch the apps/search window in the bottom left: <img src="/files/kOykmDWRCfON5mWRrV2L" alt="" data-size="line">\
Search "text editor" and open the app.
{% endhint %}

<figure><img src="/files/e0n6LesU0FR4yVQDZg5a" alt=""><figcaption></figcaption></figure>

**2) Paste the following text into the document:**

```
#!/bin/bash

# Update Geth
# Step 1: Stop Geth
sudo systemctl stop geth

# Step 2: Change to Home directory
cd ~

# Step 3: Use curl to download latest version
curl -LO https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.5-a38f4108.tar.gz

# Step 4: Extract, Copy, and Clean up
tar xvf geth-linux-amd64-1.11.5-a38f4108.tar.gz
cd geth-linux-amd64-1.11.5-a38f4108 && sudo cp geth /usr/local/bin
cd ..
rm geth-linux-amd64-1.11.5-a38f4108.tar.gz
rm -r geth-linux-amd64-1.11.5-a38f4108

# Step 5: Start Geth
sudo systemctl start geth

# Update Lighthouse
# Step 1: Change directory to Home folder
cd ~

# Step 2: Download Lighthouse software
curl -LO https://github.com/sigp/lighthouse/releases/download/v4.0.1/lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz

# Step 3: Stop Lighthouse services
sudo systemctl stop lighthousevalidator
sudo systemctl stop lighthousebeacon

# Step 4: Extract, Copy, and Clean up
tar xvf lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz
sudo cp lighthouse /usr/local/bin
rm lighthouse-v4.0.1-x86_64-unknown-linux-gnu.tar.gz
rm lighthouse

# Step 5: Start Lighthouse services
sudo systemctl start lighthousebeacon
sudo systemctl start lighthousevalidator

# Print the version of Lighthouse
lighthouse_version=$(lighthouse --version)
echo "LIGHTHOUSE VERSION: "
echo "$lighthouse_version"

# Print the version of Geth
geth_version=$(geth --version)
echo "GETH VERSION: "
echo "$geth_version"

```

**3) Save the file (`ctrl+s`) in your Documents folder as `update.sh`**

{% hint style="info" %}
Be sure to save the file in your Documents folder
{% endhint %}

**4) Open a new terminal with (`ctrl+shift+t)`**

**5) Change to Documents directory:**

```
cd ~/Documents
```

**6) Make the script executable:**

```
chmod +x update.sh
```

**7) Run the update script:**

```
./update.sh
```

You should see the updated versions printed in the terminal:

<figure><img src="/files/ajgRIRHHSWTkHDNqua0B" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
That's it, Geth and Lighthouse are now ready for the Shanghai fork on April 12, 2023
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://agstakingco.gitbook.io/eth-updates-april-12-2023/bash-script.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
