Skip to content

Commit 6dbf904

Browse files
xumiamssonicbld
authored andcommitted
[Bug] Fix SONiC installation failure caused by pip/pip3 not found (sonic-net#13284)
The main issue is the pip/pip3 command cannot be found when the package is being installed by apt-get. When using the dpkg install, the searching path is PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin When using the apt-get install, the searching path is PATH=/usr/sbin:/usr/bin:/sbin:/bin But the pip/pip3 default path is at /usr/local/bin, so dpkg works, but apt-get not work. How I did it Export the path /usr/local/bin for pip/pip3. Make the deb packages can be installed by apt-get.
1 parent b443cc8 commit 6dbf904

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

files/image_config/platform/rc.local

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ if [ -f $FIRST_BOOT_FILE ]; then
289289
mv /etc/apt/sources.list /etc/apt/sources.list.rc-local
290290
echo "deb [trusted=yes] file:///host/image-$SONIC_VERSION/platform/common /" > /etc/apt/sources.list.d/sonic_debian_extension.list
291291
LANG=C DEBIAN_FRONTEND=noninteractive apt-get update
292-
LANG=C DEBIAN_FRONTEND=noninteractive apt-get -y install /host/image-$SONIC_VERSION/platform/$platform/*.deb
292+
LANG=C DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Path=$PATH:/usr/local/bin -y install /host/image-$SONIC_VERSION/platform/$platform/*.deb
293293
# Cleanup
294294
rm -f /etc/apt/sources.list.d/sonic_debian_extension.list
295295
rm -f /var/lib/apt/lists/_host_image-${SONIC_VERSION}_platform_common_Packages.lz4

0 commit comments

Comments
 (0)