EEVblog Electronics Community Forum

Electronics => PCB/EDA/CAD => KiCad => Topic started by: Sceptic on January 26, 2024, 06:49:33 pm

Title: [Solved] Problem downloading/installing KiCad from main site.
Post by: Sceptic on January 26, 2024, 06:49:33 pm
Hi all,

First, I'm on Ubuntu:
Code: [Select]
xxx@xxx:~$ uname -a
Linux Node1 6.5.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan  9 17:03:36 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

I'm trying to update to 7.0.10 from 7.0.7 which is found in the Ubuntu repo currently.

Second, If I do
Code: [Select]
sudo add-apt-repository ppa:kicad/kicad-7.0-releases
I'll get the following error/message:
Code: [Select]
sh: 1: /usr/lib/linuxmint/mintSources/mintSources.py: not found

I did get this problem with the 6.x.x series as well but never pursued the problem further back then.

Has anyone ran into this problem and/or found a solution for this?

This is solved; please see reply #11.

Sceptic
Title: Re: Problem downloading/installing KiCad from main site.
Post by: SiliconWizard on January 26, 2024, 09:34:06 pm
Why not ask in Ubuntu's forums instead?
Title: Re: Problem downloading/installing KiCad from main site.
Post by: Benta on January 26, 2024, 10:42:29 pm
Just do:

sudo apt update
sudo apt upgrade

Then you'll be on 7.0.10

Title: Re: Problem downloading/installing KiCad from main site.
Post by: shapirus on January 26, 2024, 11:22:27 pm
Yeah basically external repos (PPAs) aren't needed, unless you're after the latest nightly builds. It's in standard repositories: https://packages.ubuntu.com/search?keywords=kicad&searchon=names&suite=all&section=all
Title: Re: Problem downloading/installing KiCad from main site.
Post by: retiredfeline on January 26, 2024, 11:53:42 pm
The problem with the official Ubuntu repos is only older KiCad versions are available for older Ubuntu releases that still in support. For example the official repo has only v6 for Jammy, but the KiCad PPA has up to date v7 packages for Jammy.
Title: Re: Problem downloading/installing KiCad from main site.
Post by: Sceptic on January 27, 2024, 08:52:14 am
Why not ask in Ubuntu's forums instead?
One has to start somewhere, no?
As the instructions for adding the ppa and update is on the official KiCad site, I thought maybe other KiCad users had seen this issue as well.
It seems to me that this forum has a lot of users, so potentially the chances that someone facing the same issue is higher.
Title: Re: Problem downloading/installing KiCad from main site.
Post by: Sceptic on January 27, 2024, 08:53:09 am
Just do:

sudo apt update
sudo apt upgrade

Then you'll be on 7.0.10
If I could add the ppa, then yes.
Title: Re: Problem downloading/installing KiCad from main site.
Post by: Sceptic on January 27, 2024, 09:06:08 am
Yeah basically external repos (PPAs) aren't needed, unless you're after the latest nightly builds. It's in standard repositories: https://packages.ubuntu.com/search?keywords=kicad&searchon=names&suite=all&section=all (https://packages.ubuntu.com/search?keywords=kicad&searchon=names&suite=all&section=all)
If you go to https://www.kicad.org/download/linux/ (https://www.kicad.org/download/linux/) and under "Officially-supported Platforms" (for Ubuntu), the first paragraph says:
Quote
KiCad operates PPAs that can be used to install KiCad along with its required dependencies. We recommend that users install from these PPAs rather than the base Ubuntu repository as the latter is usually outdated.

It seems to me that, following your link, 7.0.10 will end up in Noble (Ubuntu 24.04), so I could probably wait 3 month for that, but wait! Isn't the 8.x.x series expected end of January?
Title: Re: Problem downloading/installing KiCad from main site.
Post by: retiredfeline on January 27, 2024, 09:36:16 am
Hmm, are you on Ubuntu or Mint? From the missing filename you mentioned it sounds like you are on Mint, in which case you should ask on a Mint forum. (I'm not a Mint user.) On the other hand if you are really on Ubuntu, then what is that interloper file from Mint doing there?
Title: Re: Problem downloading/installing KiCad from main site.
Post by: shapirus on January 27, 2024, 09:40:21 am
It seems to me that, following your link, 7.0.10 will end up in Noble (Ubuntu 24.04), so I could probably wait 3 month for that, but wait! Isn't the 8.x.x series expected end of January?
There are ways. You can do any of:

1) add the Noble repositories in /etc/apt/sources.list[.d], then install kicad 7.0.10 and let it pull the dependencies it needs -- but this will update parts of your system with packages from what will become Noble; it usually works fine for advanced users; YMMV, this assumes more than basic knowledge of dpkg, apt, and the principles of debian package management in general.

2) pull the deb source package for 7.0.10 from Noble (for which you need to add the respective deb-src, and only deb-src, to your sources.list) and build your own deb package that will have your current distro's library versions as dependencies -- this is the safest and usually the easiest way, when installing existing binary packages fails for whatever reason

3) same as 2, but add KiCad external repositories and pull the source packages from there, for whatever version you need. If you go this far, then there's no reason not to try 8.0, since it's pretty close to be released and is very usable as it is now. Once released, you can easily update the package (which may or may not need to be built from source on your system).

Whatever you do, before installing any new package, use dpkg -l|grep kicad and dpkg-repack to save a copy of what kicad-related packages are currently installed so that you can reinstall them if things go wrong. Also make sure you back up your ~/.config/kicad and ~/.local/share/kicad before running an updated version.

p.s. note that option 3 is distro-agnostic: it will (usually) work for any Debian derivative.

p.p.s. that mint-related error looks weird, as though you were on Mint at some point and then switched to Ubuntu, or installed some Mint packages manually etc. -- is the error the same for any PPA that you're trying to add, and not just kicad's?
You may grep for /usr/lib/linuxmint/mintSources/mintSources.py in /usr/bin and /usr/lib to find out where it's coming from and/or sudo apt reinstall software-properties-common (which contains apt-add-repository) for an easy attempt to fix it. Also dpkg -l|grep mint, grep -r mint /etc/apt.
Title: Re: Problem downloading/installing KiCad from main site.
Post by: Sceptic on January 27, 2024, 10:27:17 am
Hmm, are you on Ubuntu or Mint? From the missing filename you mentioned it sounds like you are on Mint, in which case you should ask on a Mint forum. (I'm not a Mint user.) On the other hand if you are really on Ubuntu, then what is that interloper file from Mint doing there?
I'm on Ubuntu. I have never installed or used Mint on this machine or other machines.
It's possible that I have installed something that pulled in some Mint stuff at some point, but I've no idea what that would be.
Title: Re: Problem downloading/installing KiCad from main site.
Post by: Sceptic on January 27, 2024, 11:13:18 am
It seems to me that, following your link, 7.0.10 will end up in Noble (Ubuntu 24.04), so I could probably wait 3 month for that, but wait! Isn't the 8.x.x series expected end of January?
There are ways. You can do any of:

1) add the Noble repositories in /etc/apt/sources.list[.d], then install kicad 7.0.10 and let it pull the dependencies it needs -- but this will update parts of your system with packages from what will become Noble; it usually works fine for advanced users; YMMV, this assumes more than basic knowledge of dpkg, apt, and the principles of debian package management in general.

2) pull the deb source package for 7.0.10 from Noble (for which you need to add the respective deb-src, and only deb-src, to your sources.list) and build your own deb package that will have your current distro's library versions as dependencies -- this is the safest and usually the easiest way, when installing existing binary packages fails for whatever reason

3) same as 2, but add KiCad external repositories and pull the source packages from there, for whatever version you need. If you go this far, then there's no reason not to try 8.0, since it's pretty close to be released and is very usable as it is now. Once released, you can easily update the package (which may or may not need to be built from source on your system).

Whatever you do, before installing any new package, use dpkg -l|grep kicad and dpkg-repack to save a copy of what kicad-related packages are currently installed so that you can reinstall them if things go wrong. Also make sure you back up your ~/.config/kicad and ~/.local/share/kicad before running an updated version.

p.s. note that option 3 is distro-agnostic: it will (usually) work for any Debian derivative.

p.p.s. that mint-related error looks weird, as though you were on Mint at some point and then switched to Ubuntu, or installed some Mint packages manually etc. -- is the error the same for any PPA that you're trying to add, and not just kicad's?
You may grep for /usr/lib/linuxmint/mintSources/mintSources.py in /usr/bin and /usr/lib to find out where it's coming from and/or sudo apt reinstall software-properties-common (which contains apt-add-repository) for an easy attempt to fix it. Also dpkg -l|grep mint, grep -r mint /etc/apt.
Thank you for your various suggestions. Unfortunately none of them solves the root cause of the issue.
I did reinstall software-properties-common as suggested in a post I found while searching the net, but it didn't help.

Fortunately, I found a clue in this post: https://askubuntu.com/questions/825491/unable-to-add-apt-repository-in-ubuntu-server-14-04 (https://askubuntu.com/questions/825491/unable-to-add-apt-repository-in-ubuntu-server-14-04)
I did
Code: [Select]
sudo updatedb
then
Code: [Select]
locate add-apt
and the result was:
Code: [Select]
/usr/bin/add-apt-repository
/usr/local/bin/add-apt-repository
/usr/share/bash-completion/completions/add-apt-repository
/usr/share/man/man1/add-apt-repository.1.gz
So I have two versions of add-apt-repository.
My $PATH looks like this:
Code: [Select]
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
I just renamed the version in the /usr/local/bin directory (because it's searched before /usr/bin) and, lo and behold, I could add the repo using KiCads instructions, so I'm on 7.0.10 now  :)
How that version (for Mint?) ended up in /usr/bin/local I don't know.

I think it's time to do a fresh install on this machine; I've just been upgrading it whenever there is a new Ubuntu version out.
Thanks
Title: Re: [Solved] Problem downloading/installing KiCad from main site.
Post by: djsb on January 27, 2024, 11:41:13 am
I just upgraded 5 minutes ago my Mint installation to 21.3 "Virginia". I'm using the PPA deb http://ppa.launchpad.net/kicad/kicad-dev-nightly/ubuntu (http://ppa.launchpad.net/kicad/kicad-dev-nightly/ubuntu) jammy main.
My kicad nightly was today updated to Kicad V8.00RC2. Hope that helps.