How to wget the latest lxc

Hi, guys.

I need to wget the latest Oracle 9 lxc for amd64. If exist a constant for that?

https://images.linuxcontainers.org/images/oracle/9/amd64/default/20251225_07%3A46/rootfs.tar.xz

# Set base URL
BASE_URL="https://images.linuxcontainers.org/images/oracle/9/amd64/default"

# Get the latest build date
LATEST_DATE=$(wget -q -O - [URL]https://images.linuxcontainers.org/meta/1.0/index-system[/URL] | grep -o "oracle;9;amd64;default;[0-9]\{8\}\_[0-9]\{2\}\:[0-9]\{2\}" | cut -d';' -f5
echo "Downloading Oracle Linux 9 LXC image from: ${BASE_URL}/${LATEST_DATE}/"

# Download files
wget -q -c "${BASE_URL}/${LATEST_DATE}/rootfs.tar.xz"
wget -q -c "${BASE_URL}/${LATEST_DATE}/meta.tar.xz"

echo "Download complete!"
echo "Date: ${LATEST_DATE}"
echo "Files: rootfs.tar.xz, meta.tar.xz"

cp rootfs.tar.xz /var/lib/vz/template/cache/oracle-linux-9.tar.xz

Welcome!

With the following command you can list the available images. The oracle/9 part, works as a search filter. You have oracle/9 and oracle/9/cloud images, the latter has support for cloud-init and also includes a non-root account named oracle.

$ incus image list images:oracle/9
+-------------------------+--------------+--------+-------------------
|          ALIAS          | FINGERPRINT  | PUBLIC |           DESCRIPT
+-------------------------+--------------+--------+-------------------
| oracle/9 (3 more)       | 40481d2a3364 | yes    | Oracle 9 amd64 (20
+-------------------------+--------------+--------+-------------------
| oracle/9/arm64 (1 more) | 9e2a788d49ae | yes    | Oracle 9 arm64 (20
+-------------------------+--------------+--------+-------------------
| oracle/9/cloud (1 more) | ba746842e050 | yes    | Oracle 9 amd64 (20
+-------------------------+--------------+--------+-------------------
| oracle/9/cloud/arm64    | f8c84f079404 | yes    | Oracle 9 arm64 (20
+-------------------------+--------------+--------+-------------------
$

However, to answer your question, you can download the latest image using the incus image export command. You will be exporting from images:oracle/9 into the current working directory. Incus will always fetch the latest image.

$ incus image export images:oracle/9 
Image exported successfully!                 
$ ls -l incus.tar.xz rootfs.squashfs 
-rw-rw-r-- 1 user user       904 Δεκ  25 23:09 incus.tar.xz
-rw-rw-r-- 1 user user 104038400 Δεκ  25 23:09 rootfs.squashfs
$ 

If you want to retrieve metadata so that you can identify the dates of the downloaded images, you can incus image info the image.

$ incus image info images:oracle/9
Fingerprint: 40481d2a336445659b790a83a7f0b5b725cbcb380f3e37e2d5044361220c0388
Size: 99.22MiB
Architecture: x86_64
Type: container
Public: yes
Timestamps:
    Created: 2025/12/25 02:00 EET
    Uploaded: 2025/12/25 02:00 EET
    Expires: 1970/01/01 02:00 EET
    Last used: never
Properties:
    release: 9
    architecture: amd64
    variant: default
    type: squashfs
    serial: 20251225_07:46
    description: Oracle 9 amd64 (20251225_07:46)
    requirements.cdrom_agent: true
    os: Oracle
Aliases:
    - oracle/9/default
    - oracle/9/default/amd64
    - oracle/9
    - oracle/9/amd64
Cached: no
Auto update: disabled
Profiles: []
$

If you want to get the serial, you would

$ incus image get-property images:oracle/9 serial
20251225_07:46
$ 
1 Like