I am using emacs 26.3, and when I try to use the package manager, I get that every…
- User
I am using emacs 26.3, and when I try to use the package manager, I get that every package is "incompat". How can I fix this?
- Assistant
A frustrating issue!
The "incompat" status in Emacs' package manager (
list-packages) usually indicates that the package is not compatible with your current Emacs version. This can happen for a few reasons:- Emacs 26.3 is relatively old: Emacs 26.3 was released in 2019, and many package maintainers have since dropped support for it in favor of newer Emacs versions (e.g., 27, 28, or 29). Many packages now require Emacs 27 or later.
- Package archive configuration: Emacs' package manager fetches packages from archives (e.g., MELPA, GNU ELPA, or NonGNU ELPA). If your archive configuration is outdated or incorrect, you might not get packages compatible with your Emacs version.
- Package metadata issues: Sometimes, package metadata (e.g., the
package-versionoremacs-versionfields in the package's-pkg.elfile) can be incorrect or missing, leading to compatibility misdetection.
Here are steps to help you resolve the "incompat" issue:
1. Update your package archives: Ensure your
package-archivesvariable is up-to-date and includes the following:(require 'package) (setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") ("nongnu" . "https://elpa.nongnu.org/nongnu/") ("melpa" . "https://melpa.org/packages/"))) (package-initialize)Add this to your
init.elor.emacsfile, then restart Emacs or evaluate the code (M-x eval-bufferorC-x C-eat the end of the expression).2. Refresh the package list: In the
*scratch*buffer (or any buffer), type:M-x package-refresh-contents RETThis will update the package index from the archives. This might take a few seconds.
3. Check
package-check-signature: Some archives (like MELPA) use package signing for security. Ifpackage-check-signatureis set tot, it can cause issues with older Emacs versions. Try setting it tonil:(setq package-check-signature nil)Add this line to your
init.elor.emacsfile and restart Emacs (or evaluate the expression).4. Use a legacy-compatible package archive (MELPA Stable): MELPA Stable (as opposed to the regular MELPA) retains older package versions compatible with Emacs 24.4–26.x. Add this archive to your
package-archives:(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") ("nongnu" . "https://elpa.nongnu.org/nongnu/") ("melpa" . "https://melpa.org/packages/") ("melpa-stable" . "https://stable.melpa.org/packages/")))Then, refresh the package list again (
M-x package-refresh-contents).5. Prioritize MELPA Stable (optional): If you want to prefer MELPA Stable packages over regular MELPA ones (when available), add this:
(setq package-archive-priorities '(("melpa-stable" . 10) ("gnu" . 5) ("nongnu" . 5) ("melpa" . 0)))Higher numbers mean higher priority.
6. Revisit the package list: Now, try
M-x list-packagesagain. Many packages should no longer be marked as "incompat". You can install older, compatible versions from MELPA Stable.Additional tips:
- If a specific package is still marked "incompat", you can try installing an older version manually: visit the package's webpage on MELPA (or another archive), find an older version (e.g., from 2020 or earlier), and download the
.tarfile. Then, in Emacs,M-x package-install-fileand select the downloaded file. - Consider upgrading to a newer Emacs version (e.g., Emacs 27 or 28) if possible. Many issues will disappear, and you'll get access to newer features and packages.
- As a last resort, you can try building Emacs 26.3-compatible packages from their source repositories (usually on GitHub). This requires some technical expertise, though.
By following these steps, you should be able to use the package manager with Emacs 26.3 again. Happy hacking!
- User
If I want to install a new version of emacs using snap, how do I see what version it is before I install it?
- Assistant
When using Snap, you can easily check the available versions of a package (in this case, Emacs) before installing it. Here's how:
Method 1: Using the
snap infocommandOpen a terminal and run:
snap info emacsThis command will display detailed information about the Emacs Snap package, including:
- Channel versions (more on this below)
- Installed version (if you already have Emacs installed via Snap)
- Description
- Publisher (in this case, the Emacs community)
The output will look something like this:
name: emacs summary: GNU Emacs is an extensible, customizable, free/libre text editor — and more. publisher: The Emacs Community (snapcrafters✓) store-url: https://snapcraft.io/emacs contact: https://github.com/snapcrafters/emacs/issues channels: latest/stable: 28.2 2023-03-30 (149) 174MB - latest/candidate: 28.2 2023-03-30 (149) 174MB - latest/beta: 29.0.50.git 2023-09-15 (184) 181MB - latest/edge: 29.0.60.git 2023-10-02 (189) 182MB - 27/stable: 27.2 2021-03-26 (57) 168MB - 27/candidate: 27.2 2021-03-26 (57) 168MB -Here's what you need to focus on:
channels:section: This lists the available versions of Emacs, each associated with a channel.latest/stable,latest/candidate,latest/beta, andlatest/edgeare the main channels:stable: The latest released version (tested and considered safe). Recommended for most users.candidate: A pre-release version, almost identical tostable, but still undergoing final testing.beta: An early version of the next major release (e.g., 29.x).edge: The absolute latest development snapshot (nightly builds). Not recommended unless you're a developer or tester.
27/stableand27/candidate: These are older, stable tracks (in this case, Emacs 27.x). Useful if you want a specific major version.
In the example above:
- If you install Emacs from the default channel (
latest/stable), you'll get Emacs 28.2. - If you're feeling adventurous,
latest/betaoffers Emacs 29.0.50.git (a development snapshot). - If you specifically need Emacs 27, use the
27/stablechannel.
Method 2: Browse the Snap Store website
Alternatively, visit the Emacs Snap Store page. Scroll down to the "Releases" section:
You'll see the same channel information as above, with versions and release dates.
Now, let's install the version you want!
To install a specific version of Emacs using Snap, use the following syntax:
sudo snap install emacs --channel=<channel_name>Examples:
- Latest stable version (currently 28.2):
sudo snap install emacs(default, same as--channel=latest/stable) - Emacs 29 beta:
sudo snap install emacs --channel=latest/beta - Emacs 27 (older stable version):
sudo snap install emacs --channel=27/stable
If you've already installed Emacs via Snap and want to switch channels (e.g., from
stabletobeta), use:sudo snap refresh emacs --channel=latest/betaThat's it! You've now seen how to:
- Check available Emacs versions in Snap.
- Choose a specific version (channel) to install.
Happy Emacsing with your freshly installed (or upgraded) version!
Side note: Snap installations are isolated (sandboxed), so:
- Your old Emacs 26.3 config (
~/.emacs.d/) will not be automatically used by the new Snap Emacs. You'll need to manually copy/move your config or symlink it (e.g.,ln -s ~/.emacs.d ~/snap/emacs/current/.emacs.d). - You can run multiple Emacs versions side-by-side (e.g.,
emacsfor Snap Emacs and/usr/bin/emacsfor your old system Emacs).
Enjoy exploring the newer Emacs features!
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.