Skip to main content

Update the APT Package Source List

Use this guide to refresh the package source list on an ArmSoM board running a Debian-, Ubuntu-, or Armbian-based system. A working source list is required before installing packages or updating the system.

Before you begin​

  • Confirm that the board is connected to the internet.
  • Use an account with sudo permission.
  • Back up the current source list before changing it.
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

Check the current sources​

Display the configured repositories and any additional source files:

cat /etc/apt/sources.list
ls -la /etc/apt/sources.list.d/

The release name in the source URL must match the system release. Check it with:

. /etc/os-release && echo "$PRETTY_NAME"

Refresh the package index​

If the configured sources are correct, refresh the package index:

sudo apt update

Install available package updates only after reviewing the output:

sudo apt upgrade

Troubleshooting​

If apt update reports a repository error, first verify the board's network connection and system date. Then check that the source URL and release name match /etc/os-release.

To restore the previous configuration:

sudo cp /etc/apt/sources.list.backup /etc/apt/sources.list
sudo apt update

Do not mix repositories from different Debian, Ubuntu, or Armbian releases. Doing so can prevent future upgrades or cause package conflicts.

Check the clock and time zone on a fresh image​

After booting a freshly flashed ArmSoM SDK image, connect to the internet and check the system clock. APT may report Release file ... is not valid yet when the board clock is behind the repository metadata.

timedatectl status
timedatectl list-timezones

If the time zone is wrong, choose the zone for your location. This example uses mainland China.

sudo timedatectl set-timezone Asia/Shanghai
sudo timedatectl set-ntp true
timedatectl status
Check the actual date

If you see NTP not supported or NTP service: n/a, use the manual command below first. Check the actual date even when System clock synchronized says yes; changing the time zone does not correct an incorrect date.

If automatic synchronization is unavailable or the date is still incorrect, set the clock manually. Replace the date, time, and UTC offset below with your current values, then rerun sudo apt update.

sudo date -s 'YYYY-MM-DD HH:MM:SS +0800'

Ubuntu 22.04 third-party repository stalls​

Confirm that /etc/apt/sources.list contains official Ubuntu sources matching the installed release. You can then skip /etc/apt/sources.list.d/ for this invocation. Run these commands with sudo to refresh the index and install the missing python3-venv package. If other dependencies are missing, use the same option with the installation command in the original guide.

sudo apt-get -o Dir::Etc::sourceparts=- -o Acquire::Retries=0 -o Acquire::http::Timeout=20 update
sudo apt-get -o Dir::Etc::sourceparts=- install -y python3-venv

These options apply to the commands shown and leave the source files unchanged.

Debian 12 configured mirrors are unreachable​

Use the official Debian HTTPS repositories temporarily. The install command uses python3-venv as an example. Substitute the packages required by the guide you are following.

cat > ~/debian-bookworm.list <<'EOF'
deb https://deb.debian.org/debian bookworm main contrib
deb https://deb.debian.org/debian bookworm-updates main contrib
deb https://deb.debian.org/debian-security bookworm-security main contrib
EOF

sudo apt-get -o Dir::Etc::sourcelist="$HOME/debian-bookworm.list" \
-o Dir::Etc::sourceparts=- update &&
sudo apt-get -o Dir::Etc::sourcelist="$HOME/debian-bookworm.list" \
-o Dir::Etc::sourceparts=- install -y python3-venv
Contact us