
GitHub Copilot transforms how you write code, but getting it running on Linux Mint 22 requires the right approach. Many developers struggle with Flatpak sandboxing issues, authentication failures, and outdated package repositories when they try to install GitHub Copilot on Linux Mint 22. This guide walks you through the exact commands I use on production systems after 10 years of managing Linux environments.
You will learn how to install VS Code from Microsoft’s official repository, add the GitHub Copilot extension, authenticate your account, and install the Copilot CLI for terminal use. The GitHub Copilot on Linux Mint 22 setup process takes about 15 minutes when you follow these tested steps. I have written this tutorial based on real-world experience with Linux Mint 22 “Wilma” and the latest VS Code versions.
Prerequisites: What You Need Before You Begin
Before you start installing GitHub Copilot on Linux Mint 22, verify you have these requirements met. Skipping prerequisites causes most installation failures.
- Linux Mint 22 (Cinnamon, MATE, or Xfce) based on Ubuntu 24.04 LTS with kernel 6.8 or later
- Active GitHub Copilot subscription (Free, Pro at $10/month, or Business) verified at github.com/features/copilot
- sudo administrative privileges to install packages and add repositories
- Working internet connection to download VS Code, extensions, and authenticate with GitHub
- Terminal access with bash shell (default in Linux Mint)
- Node.js 22+ and npm 10+ if you want Copilot CLI for command-line use
Check your Linux Mint version by running this command:
cat /etc/linuxmint/info
You should see MINT_VERSION="22" in the output. If you run Linux Mint 21.x, upgrade to Mint 22 first because older versions lack glibc 2.39 required by modern VS Code binaries.
Step 1: Update Your Linux Mint 22 System Before Installation
Run System Update Commands
Open your terminal and execute these commands to refresh package lists and upgrade existing software:
sudo apt update -y
sudo apt upgrade -y
The apt update command downloads the latest package indexes from all configured repositories. Without this step, you might install outdated VS Code versions or encounter “package not found” errors. The apt upgrade command applies security patches and bug fixes to your current system packages.
Expected output: You will see lines like “Reading package lists… Done” and “Building dependency tree… Done” followed by “0 upgraded, 0 newly installed” if your system is already up to date.
Install Essential Build Dependencies
Install tools required for adding secure repositories and downloading files:
sudo apt install curl apt-transport-https wget gpg -y
Each tool serves a specific purpose:
- curl downloads files from URLs using HTTP/HTTPS
- apt-transport-https enables APT to access repositories over secure HTTPS connections
- wget downloads files as a backup method if curl fails
- gpg verifies package signatures to ensure they come from Microsoft and haven’t been tampered with
This is a security best practice. Never skip GPG verification when adding third-party repositories to your system.
Step 2: Install Visual Studio Code on Linux Mint 22 Using Official Repository
Why You Should Avoid Flatpak VS Code
Many Linux Mint users install VS Code from the Software Manager, which uses the Flatpak version. Flatpak sandboxing restricts access to system keyrings needed for GitHub authentication. This causes the Copilot sign-in button to fail repeatedly.
For the GitHub Copilot on Linux Mint 22 setup, always use VS Code from Microsoft’s official APT repository. This method integrates VS Code into the system PATH and enables automatic updates through apt upgrade.
Add Microsoft’s GPG Signing Key
Download and install Microsoft’s GPG key to verify package authenticity:
sudo apt-get install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
rm -f packages.microsoft.gpg
The GPG key acts like a digital signature certificate. When you install VS Code, APT checks this signature to confirm Microsoft created the package. This prevents attackers from injecting malicious code into your system.
The rm -f packages.microsoft.gpg command deletes the temporary key file after installation to keep your home directory clean.
Add the Microsoft VS Code Repository
Configure APT to download VS Code from Microsoft’s servers:
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
This command creates a new file at /etc/apt/sources.list.d/vscode.list that tells APT where to find VS Code packages. The signed-by parameter points to the GPG key you just installed. Without this repository, you would need to manually download .deb files every time VS Code updates.
The > /dev/null redirects output to discard it, keeping your terminal clean since tee normally prints the content it writes.
Update Package Index and Install VS Code
Refresh APT’s package list and install VS Code:
sudo apt update -y
sudo apt install code -y
The code package is VS Code’s official package name in Microsoft’s repository. Installing via APT makes the code command available in your terminal, allowing you to open files with code myfile.py.
Expected output: You will see “Setting up code (1.x.x-xxxxxxx)” followed by “Processing triggers for desktop database…”
Verify VS Code Installation
Confirm VS Code installed correctly and check the version:
code --version
Expected output:
1.96.0
abcdef1234567890
x64
The first line shows the version number (1.96.0 or later). Copilot requires VS Code 1.70 or higher, so any version from late 2022 works. The second line is the commit hash, and the third line shows your system architecture.
If you get “command not found,” restart your terminal or run hash -r to refresh the command cache.
Step 3: Install GitHub Copilot Extension in VS Code
Open VS Code Extensions Panel
Launch VS Code and open the Extensions panel using one of these methods:
- Press
Ctrl + Shift + Xkeyboard shortcut - Click the Extensions icon (four squares) in the left sidebar
- Run
code --extensionsfrom terminal
The Extensions panel is where VS Code manages all plug-ins. You need this panel to search for and install GitHub Copilot.
Search and Install GitHub Copilot Extension
Type “GitHub Copilot” in the search box at the top of the Extensions panel. Look for the extension published by GitHub (not third-party publishers). Click the Install button.
This installs the core Copilot extension that provides inline code suggestions as you type. The official extension receives monthly updates from Microsoft and includes bug fixes and new language support.
Installation time: About 10–30 seconds depending on your internet speed.
Install GitHub Copilot Chat Extension
Search for “GitHub Copilot Chat” and click Install to add this complementary extension.
The Copilot Chat extension enables the chat interface where you can ask questions like “Explain this function” or “Generate unit tests for this code.” While the main Copilot extension provides inline suggestions, Chat helps with complex tasks and code explanations.
Verify Extensions Are Installed
Open the terminal inside VS Code (Ctrl + `) and run:
code --list-extensions | grep -i copilot
Expected output:
GitHub.copilot
GitHub.copilot-chat
This command lists all installed extensions and filters for “copilot” in the name. Seeing both extensions confirms successful installation. If you see only one extension, reinstall the missing one.
Step 4: Authenticate GitHub Copilot in VS Code
Trigger the Authentication Prompt
After installing the extensions, a notification appears in the bottom-right corner saying “GitHub Copilot: Sign in to use Copilot”. Click “Sign in to GitHub”.
If you miss the notification, click the GitHub icon in the bottom-right status bar and select “Use AI Features” → “Sign in”.
Authentication is required because GitHub must verify your subscription and link your account to VS Code. Without authentication, Copilot shows suggestions but marks them as inactive.
Complete Device Code Authentication in Browser
VS Code opens a browser window automatically, or displays a device code like this:
To sign in, use a web browser to open the page https://github.com/login/device and enter the code ABCD-1234
Follow these steps:
- Copy the device code (ABCD-1234)
- Open your browser and go to github.com/login/device
- Paste the code and click Continue
- Click “Authorize Visual-Studio-Code” when prompted
The device flow authentication is more secure than entering credentials directly in VS Code. It prevents keyloggers from stealing your password and works behind corporate firewalls that block direct OAuth redirects.
Verify Copilot Status
After authorization, return to VS Code. The GitHub icon in the bottom-right status bar should change from a grayed-out circle to a colored icon showing “Status: Ready”.
Click the icon to see a dropdown menu with options like “Copilot: Enable”, “Copilot: Disable”, and “Copilot: Settings”. A “Ready” status confirms successful authentication and active subscription verification.
Troubleshooting Sign-In Button Not Responding
If the sign-in button does nothing when you click it, your VS Code settings may have corrupted authentication data. Open Settings in JSON format:
Ctrl+Shift+P → Type "Preferences: Open Settings (JSON)" → Press Enter
Find and remove this block if it exists:
"github.copilot.advanced": {
"authProvider": "github"
}
Save the file and reload VS Code with Ctrl+Shift+P → "Reload Window". This forces VS Code to re-initiate the OAuth authentication process from scratch.
Step 5: Install GitHub Copilot CLI for Terminal Use
Install Node.js 22+ If Not Already Installed
Copilot CLI requires Node.js 22 or later. Check your version:
node -v
If you see a version lower than 22.x.x or “command not found,” install Node.js from NodeSource:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install nodejs -y
The curl command downloads the NodeSource setup script, which adds the Node.js 22 repository to your system. The -fsSL flags make curl follow redirects, fail on errors, and suppress progress output. Node.js 22+ is required because Copilot CLI uses modern JavaScript features not available in older versions.
Verify Node.js and npm Versions
Confirm both tools installed correctly:
node -v
npm -v
Expected output:
v22.14.0
10.9.2
You need Node.js version 22.x.x or higher and npm version 10.x.x or higher. These versions ensure compatibility with the latest Copilot CLI package.
Install Copilot CLI via npm
Install the Copilot CLI globally so you can use it from any directory:
npm install -g @github/copilot
The -g flag installs the package globally, making the copilot command available system-wide. Without -g, npm would install it locally to your project directory, requiring you to use npx copilot instead.
Expected output:
added 1 package in 3s
1 package is looking for funding
Authenticate Copilot CLI
Copilot CLI uses separate authentication from VS Code. Run:
copilot /login
Follow the same device flow authentication as VS Code. This creates a token stored in ~/.config/copilot/config.json for terminal use. You must authenticate CLI separately because it runs outside VS Code’s authentication context.
Verify CLI Installation and Test Functionality
Check the CLI version and test with a real command:
copilot --version
copilot explain "ls -la | grep '^d'"
Expected output:
0.1.2
The command lists only directories (directories start with 'd' in the long listing format)
The explain command demonstrates that Copilot CLI can communicate with GitHub’s AI servers and provide meaningful explanations. If you get “command not found,” restart your terminal to refresh the PATH.
Step 6: Configure GitHub Copilot on Linux Mint 22 for Optimal Performance
Open Copilot Settings in VS Code
Press Ctrl + , to open Settings, then search for “Copilot” in the search box. This filters the settings to show only Copilot-related options.
Customizing settings tailors Copilot behavior to your workflow. For example, you might disable suggestions for certain file types or adjust how often suggestions appear.
Key Settings to Adjust for Better Performance
| Setting | Recommended Value | Why This Matters |
|---|---|---|
github.copilot.enable |
true for all languages |
Ensures suggestions work across Python, JavaScript, Bash, and other languages |
github.copilot.advanced |
Leave empty unless using GitHub Enterprise | Prevents authentication conflicts with personal accounts |
telemetry.telemetryLevel |
off if privacy-focused |
Disables code suggestion telemetry if you don’t want Microsoft collecting usage data |
github.copilot.editor.enableAutoCompletions |
true |
Enables inline suggestions as you type instead of requiring manual trigger |
Disable Copilot for Specific File Types
If Copilot suggestions slow down editing in large files, add this to your settings.json:
{
"github.copilot.enable": {
"text": false,
"plaintext": false,
"markdown": true
}
}
This disables suggestions for plain text files while keeping them enabled for Markdown. Large log files or minified JavaScript can cause latency, so disabling Copilot for those file types improves performance.
Troubleshooting: Common Errors When Installing GitHub Copilot on Linux Mint 22
Even with careful following of steps, you might encounter issues. Here are the most common problems and their solutions based on real sysadmin experience.
Error 1: Copilot Suggestions Not Appearing
Problem: You installed Copilot but see no inline suggestions when typing code.
Diagnosis steps:
- Press
Ctrl+Shift+Pand type “GitHub Copilot: Status” - Check if status shows “Active” or “Unauthorized”
- Verify your subscription at github.com/features/copilot
Fix: Run Ctrl+Shift+P → "GitHub Copilot: Reload" to refresh the extension state. Then restart VS Code completely.
Why this happens: VS Code extensions sometimes require a window reload to activate after installation. The extension may also lose connection to GitHub’s suggestion servers if your firewall blocks certain ports.
Error 2: “Extension Is Not Compatible With This Version of VS Code”
Problem: VS Code shows a warning that Copilot requires a newer VS Code version.
Cause: You have VS Code 1.69 or older, but Copilot requires 1.70 or later.
Fix: Update VS Code to the latest version:
sudo apt update && sudo apt upgrade code -y
code --version
Why this happens: Microsoft updates VS Code monthly, and older versions lack the extension API needed for AI features. The Microsoft APT repository ensures you always get the latest version automatically.
Error 3: GitHub Authentication Fails Behind Corporate Firewall
Problem: The device code authentication page loads but never completes, or shows “Authentication failed.”
Cause: Corporate firewalls may block OAuth device flow or proxy your connection incorrectly.
Fix: Use a fine-grained personal access token (PAT) instead:
- Go to github.com/settings/tokens
- Create a new token with “Copilot Requests” permission
- In VS Code:
Ctrl+Shift+P → "GitHub Copilot: Sign in with Token" - Paste your PAT
Why this works: PATs provide a more reliable authentication method than device flow when network restrictions exist.
Error 4: Flatpak VS Code Causes Authentication Issues
Problem: You installed VS Code from Software Manager (Flatpak), and Copilot sign-in fails repeatedly.
Fix: Uninstall Flatpak version and install via Microsoft APT repository:
flatpak remove com.visualstudio.code
sudo apt update
sudo apt install code -y
Why this happens: Flatpak sandboxing restricts access to GNOME Keyring and other system authentication services that VS Code needs for GitHub login. The native .deb package has full system access.
Error 5: Copilot CLI Not Found After Installation
Problem: Running copilot --version returns “command not found.”
Cause: The npm global installation directory is not in your PATH.
Fix: Add npm global bin directory to your PATH by adding this line to ~/.bashrc:
export PATH=$PATH:$(npm config get prefix)/bin
Then run source ~/.bashrc to apply changes.
Why this happens: npm installs global packages to /usr/local/bin or ~/.npm-global/bin by default. If this directory is not in your PATH, the shell cannot find the copilot command.
[su_box title=”VPS Manage Service Offer” style=”bubbles” box_color=”#000000″ radius=”10″]If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal![/su_box]