Error when sudo add-apt-repository ppa:ubuntu-toolchain-r/test on PYNQ

Hi,

I’m going to install gcc-9 on PYNQ v2.4 on ZCU-104. However, it fired the following issue while using the command %sudo add-apt-repository ppa:ubuntu-toolchain-r/test.

Do you know how to fix the issue?

Thank you

xilinx@pynq_sdu:~$ more /etc/apt/sources.list.d/multistrap-bionic.list
deb Index of /ubuntu-ports bionic main universe
deb-src Index of /ubuntu-ports bionic main universe

If you are using ubuntu 16, make sure you have the default ubuntu package list- restore back the original content of /etc/apt/sources.list based on Ubuntu 16.04 Xenial default /etc/apt/sources.list · GitHub

For ubuntu 18 you can find similar default /etc/apt/sources.list online as well.

@rock Thank you.

I’m using PYNQ v2.4 which is Ubuntu 18.04. Do you mean I find a one online and copy over /etc/apt/sources.list on PYNQ in ZCU-104?

Is the following one OK? Does amd64 matter?

@rock

I copied one from the internet and tried again. However, it still has error to execute the command as shown below.

xilinx@pynq_sdu:~$ sudo mv sources.list /etc/apt
[sudo] password for xilinx:
xilinx@pynq_sdu:~$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
Traceback (most recent call last):
File “/usr/bin/add-apt-repository”, line 107, in
sp = SoftwareProperties(options=options)
File “/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”, line 128, in init
self.reload_sourceslist()
File “/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”, line 623, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File “/usr/lib/python3/dist-packages/aptsources/distro.py”, line 93, in get_sources
(self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for pynqlinux/provo
Error in sys.excepthook:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/apport_python_hook.py”, line 145, in apport_excepthook
os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), ‘wb’) as f:
FileNotFoundError: [Errno 2] No such file or directory: ‘/var/crash/_usr_bin_add-apt-repository.0.crash’

Original exception was:
Traceback (most recent call last):
File “/usr/bin/add-apt-repository”, line 107, in
sp = SoftwareProperties(options=options)
File “/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”, line 128, in init
self.reload_sourceslist()
File “/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”, line 623, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File “/usr/lib/python3/dist-packages/aptsources/distro.py”, line 93, in get_sources
(self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for pynqlinux/provo
xilinx@pynq_sdu:~$ ls -altr /etc/apt
total 28
drwxr-xr-x 2 root root 4096 Feb 28 2018 trusted.gpg.d
drwxr-xr-x 2 root root 4096 Apr 20 2018 preferences.d
drwxr-xr-x 2 root root 4096 Feb 21 2019 sources.list.d
drwxr-xr-x 2 root root 4096 Feb 21 2019 apt.conf.d
drwxr-xr-x 100 root root 4096 Sep 21 14:25 …
-rw-rw-r-- 1 xilinx xilinx 2806 Sep 21 18:40 sources.list
drwxr-xr-x 6 root root 4096 Sep 21 18:42 .
xilinx@pynq_sdu:~$

After you have your sources.list file you need to run apt update.

For other users this is not necessary but I think you made changes to your ubuntu OS so you did not have that file.

No. I dont change the PYNQ v2.4. I just downloaded and installed the PYNQv2.4 on ZCU-104. Do you mean it’s not expected to miss the file on PYNQv2.4?