0

I wanted to find out if installing vscode from the downloadable .deb file (on Linux) would also add the repository to /etc/apt/sources.list.d.

I ran

sudo strace dpkg -i code_1.89.1-1715060508_amd64.deb > /tmp/codeinstall 2>&1

to look at all the system calls that get executed.

After the install, apt search code does find it, and I see that there is a file vscode.list in /etc/apt/sources.list.d/. Its contents are the Microsoft repository.

I searched the output of strace for anything like vscode.list or sources.list, but nothing came up. I expected to see some command either copy or create the vscode.list file.

So while the motivation for this question is to find out how the package repository file got added, a secondary question is now "how can I read the output from strace to verify whatever the answer is?"

Thank you.

perpetual
  • 109

1 Answers1

1

See postinst.template. Part of the file:

# Install repository source list
    WRITE_SOURCE=0
    if [ ! -f $CODE_SOURCE_PART ] && [ ! -f /etc/rpi-issue ]; then
        # Write source list if it does not exist and we're not running on Raspberry Pi OS
        WRITE_SOURCE=1
    elif grep -Eq "http:\/\/packages\.microsoft\.com\/repos\/vscode" $CODE_SOURCE_PART; then
        # Migrate from old repository
        WRITE_SOURCE=1
    elif grep -q "# disabled on upgrade to" $CODE_SOURCE_PART; then
        # Write source list if it was disabled by OS upgrade
        WRITE_SOURCE=1
    fi
if [ "$WRITE_SOURCE" -eq "1" ]; then
    echo "### THIS FILE IS AUTOMATICALLY CONFIGURED ###
    # You may comment out this entry, but any other modifications may be lost.
   deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/repos/code stable main" > $CODE_SOURCE_PART

Rinzwind
  • 309,379