As to Q1, trouble is that I'm currently often not in fact on Mint and can then not quickly verify things. Yes,
apt search pyserial
indeed does not hit upon the pySerial module which on Ubuntu 18.04/Mint 19 has apparently been helpfully named
python3-serial
for the repository Python 3 interpreter,
python-serial
for the Python 2 one. I believe this will not be different for Ubuntu 20.04/Mint 20, but try searching with
(the search term is a so-called regular expression). Or note those package names from the main pySerial package documentation over at
https://pyserial.readthedocs.io/en/latest/pyserial.html, "Packages".
I generally consider Software Manager a bit too slow and clunky to in fact use, but sure, it's just one way of installing repository software on Mint. Some like and advise
synaptic
but I personally tend to just use the command line:
Code: Select all
sudo apt-get install python3-serial
and/or same for
python-serial
if you'd also like it integrated into the system's Python 2 install. Very same for any other repository software. If you will be experimenting, uninstall is
Code: Select all
sudo apt-get purge --auto-remove python3-serial
Note that the
--auto-remove
switch cleans up any by the install automatically installed dependent packages that are no longer required when the main package is uninstalled (plus in fact other such packages you may currently have lingering around already). For pySerial there are no dependent packages so not here relevant, but generally it is. Personally I would, yes, uninstall the pip-retrieved version in the manner you say and grab it from the repositories as per above. Which is still not to say that is in fact generally practically important.
As to Q2, yes,
apt
interfaces with the repositories as configured in the file /etc/apt/sources.list and the directory /etc/apt/sources.list.d/, which by default means the Mint and Ubuntu software repositories and only those, and installs software from there, be it "normal software" or e.g. a Python module such as here. Whatever is available from said repositories, i.e., whatever Mint or Ubuntu has already packaged for you.
dpkg
is/interfaces with the package system on your own, local system and need for basic use not often be used directly.There's in fact for basic use little other you need than the above
apt-get install
and
apt-get purge
invocations. Together then with possibly
apt search
to find what you're looking for in the first place. Or, yes, sure, browsing through Software Manager which ends up being very much the same (save Flatpak support as integrated in Software Manager but not
apt
but that's an entirely new rabbit hole again...)