LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Updating Python version (https://www.linuxquestions.org/questions/linux-newbie-8/updating-python-version-4175634396/)

vysero 07-18-2018 04:50 PM

Updating Python version
 
Currently, I have two versions of Python on my computer. Python 2.x which came with my installation of Ubuntu 16.04 and python 3.5.2 which I downloaded via a: sudo apt-get. Now, I want to upgrade my 3.5.2 too 3.7. I was wondering what is the most efficient way of doing this and can it be done without loosing all the modules I have downloaded for 3.5.2? I already have the tar ball I just am worried about installing everything. I dont want to loose all my modules.

wagscat123 07-18-2018 07:23 PM

See 2. or (more easily) 3. and substitute 3.6 with 3.7

http://www.python36.com/install-python36-on-ubuntu/

vysero 07-19-2018 10:36 AM

Quote:

Originally Posted by wagscat123 (Post 5880955)
See 2. or (more easily) 3. and substitute 3.6 with 3.7

http://www.python36.com/install-python36-on-ubuntu/

Odd, I was able to run:

sudo add-apt-repository ppa:jonathonf/python-3.7

but when I ran:

sudo apt install python3.7

I got an error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.7
E: Couldn't find any package by glob 'python3.7'
E: Couldn't find any package by regex 'python3.7'

hydrurga 07-19-2018 10:51 AM

Quote:

Originally Posted by vysero (Post 5881189)
Odd, I was able to run:

sudo add-apt-repository ppa:jonathonf/python-3.7

but when I ran:

sudo apt install python3.7

I got an error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.7
E: Couldn't find any package by glob 'python3.7'
E: Couldn't find any package by regex 'python3.7'

Did you run sudo apt update to refresh the package indices after adding the repository?

vysero 07-19-2018 11:14 AM

Quote:

Originally Posted by hydrurga (Post 5881197)
Did you run sudo apt update to refresh the package indices after adding the repository?

Yes Sr I did do that.

hydrurga 07-19-2018 11:19 AM

Ok. Let's have a look at your software sources to see if the repository was correctly added.

Please paste the output from:

Code:

inxi -r
If inxi isn't installed on your system, install it with sudo apt install inxi.

vysero 07-19-2018 11:23 AM

Quote:

Originally Posted by hydrurga (Post 5881207)
Ok. Let's have a look at your software sources to see if the repository was correctly added.

Please paste the output from:

Code:

inxi -r
If inxi isn't installed on your system, install it with sudo apt install inxi.


Repos: Active apt sources in file: /etc/apt/sources.list
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
Active apt sources in file: /etc/apt/sources.list.d/dominik-stadler-ubuntu-dsta-xenial-ppa-xenial.list
deb http://ppa.launchpad.net/dominik-sta...ial-ppa/ubuntu xenial main
Active apt sources in file: /etc/apt/sources.list.d/getdeb.list
deb http://archive.getdeb.net/ubuntu trusty-getdeb apps
Active apt sources in file: /etc/apt/sources.list.d/jonathonf-ubuntu-python-3_7-xenial.list
deb http://ppa.launchpad.net/jonathonf/python-3.7/ubuntu xenial main
Active apt sources in file: /etc/apt/sources.list.d/openjdk-r-ubuntu-ppa-xenial.list
deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu xenial main
Active apt sources in file: /etc/apt/sources.list.d/webupd8team-ubuntu-java-xenial.list
deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main

hydrurga 07-19-2018 11:25 AM

Thanks. Ok, it's there. Can you please paste the full output from sudo apt update.

Note that you should enclose all output here within CODE tags (see the # on LQ's advanced edit menu).

vysero 07-19-2018 12:02 PM

Quote:

Originally Posted by hydrurga (Post 5881213)
Thanks. Ok, it's there. Can you please paste the full output from sudo apt update.

Note that you should enclose all output here within CODE tags (see the # on LQ's advanced edit menu).

Yep np:

Code:

rob@server038:~$ sudo apt update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease                                                 
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]                                 
Hit:4 http://ppa.launchpad.net/dominik-stadler/dsta-xenial-ppa/ubuntu xenial InRelease                     
Get:6 http://ppa.launchpad.net/jonathonf/python-3.7/ubuntu xenial InRelease [18.0 kB]                       
Get:7 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]                               
Get:8 http://security.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [67.7 kB]               
Get:9 http://security.ubuntu.com/ubuntu xenial-security/main DEP-11 64x64 Icons [68.0 kB]                   
Get:10 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [806 kB]                     
Get:11 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 DEP-11 Metadata [107 kB]           
Get:12 http://security.ubuntu.com/ubuntu xenial-security/universe DEP-11 64x64 Icons [147 kB]               
Hit:5 http://screenshots.getdeb.net trusty-getdeb InRelease                                                 
Hit:13 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu xenial InRelease                                       
Get:14 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [736 kB]                       
Hit:15 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease                                   
Get:16 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 DEP-11 Metadata [318 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu xenial-updates/main DEP-11 64x64 Icons [222 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [641 kB]
Get:19 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [584 kB]
Get:20 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [246 kB]
Get:21 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons [334 kB]
Get:22 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata [5,964 B]
Get:23 http://us.archive.ubuntu.com/ubuntu xenial-backports/main amd64 DEP-11 Metadata [3,328 B]
Get:24 http://us.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [5,100 B]
Fetched 4,632 kB in 2s (2,042 kB/s)                                     
AppStream cache update completed, but some metadata was ignored due to errors.
Reading package lists... Done
Building dependency tree     
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.


hydrurga 07-19-2018 12:46 PM

Thanks. I wonder what the metadata that was ignored was?

Let's see if Python 3.7's in the cache.

Code:

sudo apt policy python3.7

vysero 07-19-2018 12:49 PM

Quote:

Originally Posted by hydrurga (Post 5881244)
Thanks. I wonder what the metadata that was ignored was?

Let's see if Python 3.7's in the cache.

Code:

sudo apt policy python3.7

Code:

rob@server038:~$ sudo apt policy python3.7
[sudo] password for rob:
N: Unable to locate package python3.7
N: Couldn't find any package by glob 'python3.7'
N: Couldn't find any package by regex 'python3.7'

Edit: I have the tarball. Can I just unpack it in usr/local/lib?

hydrurga 07-19-2018 12:59 PM

I suspect that there's a problem with the PPA. You should contact the maintainer and ask them what's up. It might just be a temporary problem.

vysero 07-19-2018 01:04 PM

Quote:

Originally Posted by hydrurga (Post 5881248)
I suspect that there's a problem with the PPA. You should contact the maintainer and ask them what's up. It might just be a temporary problem.

Sorry, PPA? Is that the repository hosted by this jonathonf fellow?

hydrurga 07-19-2018 01:07 PM

Quote:

Originally Posted by vysero (Post 5881250)
Sorry, PPA? Is that the repository hosted by this jonathonf fellow?

Yes. A PPA is a Personal Package Archive. That's what you added to your software sources.

hydrurga 07-19-2018 01:22 PM

Just a thought. Disable the PPA and then run apt update again - if you don't receive the same "AppStream cache update completed, but some metadata was ignored due to errors" message then faulty metadata at that PPA is most probably to blame.


All times are GMT -5. The time now is 05:02 AM.