This error occurs when apt cannot locate a package in any configured repository. Common causes include package name typos, unavailable packages for your distribution, missing PPAs, or using the wrong package naming convention for specialized distributions.
The 'Couldn't find any package by glob' error indicates that the apt package manager searched through all configured repositories and could not find any package matching the name you specified. This can happen when the exact package doesn't exist, has been removed, is only available in a PPA you haven't added, or uses a different naming convention on your particular Linux distribution. The error is apt's way of telling you that the package name doesn't match anything in the available package database.
Run apt update to refresh the package database and ensure you have the latest information:
sudo apt updateThis fetches the latest package lists from all configured repositories. Without this step, apt might have outdated information about available packages.
Search for the package using apt-cache or apt search to find the exact name:
apt-cache search package-name
# or
apt search package-nameThis shows all packages matching your search term. Note the exact package name from the output and use it in your install command. Package names are case-sensitive and may include version numbers or suffixes.
Verify what version of Ubuntu/Debian you're running and whether the package is available for it:
lsb_release -a
# or
cat /etc/os-releaseSome packages are only available for specific versions. For example, older PHP versions may not be available on newer Ubuntu versions without a PPA. Check the official package repository documentation or the package maintainer's website to confirm availability.
If the package only exists in a PPA, add it first:
sudo add-apt-repository ppa:repository/name
sudo apt update
sudo apt install package-nameFor example, to install multiple PHP versions, use the Ondrej PPA:
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.3Always review the PPA details before adding it to ensure it's from a trusted source.
On specialized distributions like Proxmox VE, check the distribution documentation for the correct package naming:
# On Proxmox VE, use pve-headers instead of linux-headers
sudo apt install pve-headers-$(uname -r)
# On other distributions, linux-headers is correct
sudo apt install linux-headers-genericRunning apt-cache search on your specific distribution will show you the exact package names available.
If installing a local .deb file, always use the full path or ./ prefix:
# Correct: use full path
sudo apt install /path/to/package_name.deb
# Correct: use relative path with ./
sudo apt install ./package_name.deb
# Incorrect: relative path without ./
sudo apt install package_name.deb # This will failWithout the path prefix, apt treats it as a package name to search for in repositories rather than a local file.
The glob pattern in the error message refers to apt's glob matching system—it attempts to match your package name against package names in the repository using pattern matching. For architecture-specific issues, check available architectures with dpkg --print-foreign-architectures and dpkg --print-architecture. On multi-architecture systems, you may need to explicitly specify the architecture: apt install package-name:amd64. If you're scripting apt commands, prefer using apt-get over apt in some cases, as apt-get has more consistent behavior across different scenarios. Additionally, some packages may have complex dependency requirements or conflict with already-installed packages—use apt install --no-install-recommends to avoid unnecessary dependencies or apt simulate to preview what would be installed.
E: Could not connect to proxy server
Could not connect to proxy server
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt
E: The value 'value' is invalid for APT::Default-Release
How to fix invalid APT::Default-Release value in APT
dpkg: error: unable to create new file 'path': Permission denied
How to fix dpkg permission denied errors in APT
subprocess installed post-removal script returned error exit status 1
How to fix "subprocess installed post-removal script returned error exit status 1" in APT