Skip to content

Commit 4d2dabe

Browse files
[Desktop-lite]- libasound2 not installing in noble - issue (#973)
* [Desktop-lite]- libasound2 not installing in noble - issue * bump to patch version in Desktop-lite feature * misc change * Changes for comments ( review comments ) * changes based on review comments..
1 parent 67c10a6 commit 4d2dabe

3 files changed

Lines changed: 41 additions & 2 deletions

File tree

src/desktop-lite/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "desktop-lite",
3-
"version": "1.0.8",
3+
"version": "1.1.0",
44
"name": "Light-weight Desktop",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/desktop-lite",
66
"description": "Adds a lightweight Fluxbox based desktop to the container that can be accessed using a VNC viewer or the web. GUI-based commands executed from the built-in VS code terminal will open on the desktop automatically.",

src/desktop-lite/install.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ package_list="
4141
libnotify4 \
4242
libnss3 \
4343
libxss1 \
44-
libasound2 \
4544
xfonts-base \
4645
xfonts-terminus \
4746
fonts-noto \
@@ -198,6 +197,16 @@ fi
198197
# Install X11, fluxbox and VS Code dependencies
199198
check_packages ${package_list}
200199

200+
# if Ubuntu-24.04, noble(numbat) found, then will install libasound2-dev instead of libasound2.
201+
# this change is temporary, https://packages.ubuntu.com/noble/libasound2 will switch to libasound2 once it is available for Ubuntu-24.04, noble(numbat)
202+
. /etc/os-release
203+
if [ "${ID}" = "ubuntu" ] && [ "${VERSION_CODENAME}" = "noble" ]; then
204+
echo "Ubuntu 24.04, Noble(Numbat) detected. Installing libasound2-dev package..."
205+
check_packages "libasound2-dev"
206+
else
207+
check_packages "libasound2"
208+
fi
209+
201210
# On newer versions of Ubuntu (22.04),
202211
# we need an additional package that isn't provided in earlier versions
203212
if ! type vncpasswd > /dev/null 2>&1; then

test/desktop-lite/test.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,39 @@ set -e
55
# Optional: Import test library
66
source dev-container-features-test-lib
77

8+
echoStderr()
9+
{
10+
echo "$@" 1>&2
11+
}
12+
13+
checkOSPackage() {
14+
LABEL=$1
15+
PACKAGE_NAME=$2
16+
echo -e "\n🧪 Testing $LABEL"
17+
# Check if the package exists and retrieve its exact version
18+
if [ "$(dpkg-query -W -f='${Status}' "$PACKAGE_NAME" 2>/dev/null | grep -c "ok installed")" -eq 1 ]; then
19+
echo "✅ Package '$PACKAGE_NAME' is installed."
20+
exit 0
21+
else
22+
echo "❌ Package '$PACKAGE_NAME' is not installed."
23+
exit 1
24+
fi
25+
}
26+
827
check "desktop-init-exists" bash -c "ls /usr/local/share/desktop-init.sh"
928
check "log-exists" bash -c "ls /tmp/container-init.log"
1029
check "fluxbox-exists" bash -c "ls -la ~/.fluxbox"
1130

31+
. /etc/os-release
32+
if [ "${ID}" = "ubuntu" ]; then
33+
if [ "${VERSION_CODENAME}" = "noble" ]; then
34+
checkOSPackage "if libasound2-dev exists !" "libasound2-dev"
35+
else
36+
checkOSPackage "if libasound2 exists !" "libasound2"
37+
fi
38+
else
39+
checkOSPackage "if libasound2 exists !" "libasound2"
40+
fi
41+
1242
# Report result
1343
reportResults

0 commit comments

Comments
 (0)