(Solved) WARNING:root:could not open file '/etc/apt/sources.list'

Message
Author
User avatar
Stevo
Developer
Posts: 12841
Joined: Fri Dec 15, 2006 8:07 pm

Re: (Solved) WARNING:root:could not open file '/etc/apt/sources.list'

#21 Post by Stevo »

When searching for what packages distros have, plus if MX has them, I have found repology to be a valuable tool.

https://repology.org/metapackage/sayonara/versions

I'll update it to 1.1.1 in our test repo.

The "apt-add-repository" command presents the current distro release to a PPA, in our case MX 18 Continuum. However, since PPAs only build Ubuntu packages, that did not match any of the Ubuntu code names like xenial, bionic, etc., so that's why you got the error--and why we don't support using it on MX. You can manually add a PPA per the directions on its page with a release similar to Stretch, such as trusty (older than Stretch) or xenial (a little newer), and hope that they work, but it's a gamble that you could possibly lose in a big way, especially if you hook up a PPA that does system packages such as gcc or xorg updates.

It's always going to be safer to use our own repos.

User avatar
Stevo
Developer
Posts: 12841
Joined: Fri Dec 15, 2006 8:07 pm

Re: (Solved) WARNING:root:could not open file '/etc/apt/sources.list'

#22 Post by Stevo »

Built the 1.1.1+git20180905 release, installed, and it works well. It's on its way to the test repo, but you can get and install the deb from this zip archive: https://drive.google.com/open?id=14o78M ... mDENKrrIuP

User avatar
fehlix
Developer
Posts: 10381
Joined: Wed Apr 11, 2018 5:09 pm

Re: (Solved) WARNING:root:could not open file '/etc/apt/sources.list'

#23 Post by fehlix »

philotux wrote: Fri Feb 01, 2019 3:48 pm Does apttestrepo command work similar to the "regular" apt. That is can I run

Code: Select all

sudo apttestrepo update 
and so on?
Well, as I was looking for a way to easly checking mx testrepo from the command line without the need of changing any default source-list files within /etc/apt/source.list.d. I do use a little apt trick to use an addtional temporary source.list files for mx testrepo. Further I do not have to update for full apt-sources package list, when I only add temporary test-repo list, it's a kind of an apt-"overlay" for temporary enabling addtional sources. You can use all commands which "apt" would accept.
Examples:

Code: Select all

sudo apttestrepo update
You can check that if works in conjunction with apt:
Check version of a package in "default" repos: apt policy virtualbox

Code: Select all

LANG=en_US.UTC-8 apt policy virtualbox
virtualbox:
  Installed: 5.2.24-dfsg-4~mx17+1
  Candidate: 5.2.24-dfsg-4~mx17+1
  Version table:
 *** 5.2.24-dfsg-4~mx17+1 500
        500 http://mxrepo.com/mx/repo stretch/main amd64 Packages
        100 /var/lib/dpkg/status
     5.2.22-dfsg-1~mx17+1 500
        500 http://repo.antixlinux.com/stretch stretch/main amd64 Packages
Check version of a package with addtionally enabled "MX testrepo": apttestrepo policy virtualbox

Code: Select all

LANG=en_US.UTC-8 apttestrepo  policy virtualbox

## /etc/apt/sources.list.d/mx.list
## mx-testrepo
deb http://mxrepo.com/mx/testrepo/ stretch test
sudo apt -o Dir::Etc::sourcelist=/tmp/mx-testrepo-apt-sources.list.d-temp.fehlix.8642.529626986/temp_source.list policy virtualbox
virtualbox:
  Installed: 5.2.24-dfsg-4~mx17+1
  Candidate: 6.0.4-dfsg-1~mx17+1
  Version table:
     6.0.4-dfsg-1~mx17+1 500
        500 http://mxrepo.com/mx/testrepo stretch/test amd64 Packages
 *** 5.2.24-dfsg-4~mx17+1 500
        500 http://mxrepo.com/mx/repo stretch/main amd64 Packages
        100 /var/lib/dpkg/status
     5.2.22-dfsg-1~mx17+1 500
        500 http://repo.antixlinux.com/stretch stretch/main amd64 Packages
And without re-updateing the source again check again version available of a package in "default" repos:
apt policy virtualbox

Code: Select all

LANG=en_US.UTC-8 apt policy virtualbox
virtualbox:
  Installed: 5.2.24-dfsg-4~mx17+1
  Candidate: 5.2.24-dfsg-4~mx17+1
  Version table:
 *** 5.2.24-dfsg-4~mx17+1 500
        500 http://mxrepo.com/mx/repo stretch/main amd64 Packages
        100 /var/lib/dpkg/status
     5.2.22-dfsg-1~mx17+1 500
        500 http://repo.antixlinux.com/stretch stretch/main amd64 Packages
here my little apttestrepo wrapper script
apttestrepo:

Code: Select all

#!/bin/bash

# apttestrepo
#
# apt wrapper script to enable mx testrepo temporarily
#
# fehlix : 2019-02-01 
# posted : https://forum.mxlinux.org/viewtopic.php?p=483383#p483383
#        : 2019-02-13
# fixed  : adjusted pattern to identify testrepo
#
# Usage  : run in terminal as normal user
#        : first fetch pkg-list normally with  : sudo apt update
#        : than fetch testrepo pkg-list with   : sudo apttestrepo update
#        : now run apt or apttestrepo 
# 
#set -x

ACTION="$1"

TEMP_SOURCES_BASE="/tmp/mx-testrepo-apt-sources.list.d-temp.$USER"
TEMP_SOURCES_LIST_D="${TEMP_SOURCES_BASE}.$$.$RANDOM$RANDOM"
TEMP_SOURCES_LIST=$TEMP_SOURCES_LIST_D/temp_source.list

rm -fr ${TEMP_SOURCES_BASE}.* 2>/dev/null
mkdir $TEMP_SOURCES_LIST_D

echo -e "\n## /etc/apt/sources.list.d/mx.list" | tee  $TEMP_SOURCES_LIST
echo -e "## mx-testrepo" | tee -a $TEMP_SOURCES_LIST
cat /etc/apt/sources.list.d/mx.list | \
	grep -m1 -E "^#+[[:space:]]*(deb https?.*mx/testrepo.*)" \
  | grep -o -E "(deb https?.*mx/testrepo.*)" \
	| tee -a $TEMP_SOURCES_LIST

APT_OPTION="-o Dir::Etc::sourcelist=$TEMP_SOURCES_LIST"
[ "$ACTION" = "update" ] && APT_OPTION="-o Dir::Etc::sourceparts=- -o APT::Get::List-Cleanup=0 $APT_OPTION"


echo sudo apt $APT_OPTION "${@}"
sudo apt $APT_OPTION "${@}"

################################################
exit
################################################
:puppy:

EDIT: Update apttestrepo script with amended pattern for testrepo -line
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

philotux
Posts: 280
Joined: Sun Apr 22, 2018 12:57 pm

Re: (Solved) WARNING:root:could not open file '/etc/apt/sources.list'

#24 Post by philotux »

fehlix wrote: Fri Feb 01, 2019 6:01 pm Well, as I was looking for a way to easly checking mx testrepo from the command line without the need of changing any default source-list files within /etc/apt/source.list.d. I do use a little apt trick to use an addtional temporary source.list files for mx testrepo. Further I do not have to update for full apt-sources package list, when I only add temporary test-repo list, it's a kind of an apt-"overlay" for temporary enabling addtional sources. You can use all commands which "apt" would accept.
....
That's a really smart trick! Let's see if I can replicate your steps on my system and get it to work.
Thank you so much for taking your time to explain it so thoroughly and for sharing your script.

regards,
"philotux"

User avatar
Moltke
Posts: 229
Joined: Tue Dec 19, 2017 6:07 pm

Re: (Solved) WARNING:root:could not open file '/etc/apt/sources.list'

#25 Post by Moltke »

here my little apttestrepo wrapper script
apttestrepo:

Code: Select all

#!/bin/bash

#set -x
ACTION="$1"

TEMP_SOURCES_BASE="/tmp/mx-testrepo-apt-sources.list.d-temp.$USER"
TEMP_SOURCES_LIST_D="${TEMP_SOURCES_BASE}.$$.$RANDOM$RANDOM"
TEMP_SOURCES_LIST=$TEMP_SOURCES_LIST_D/temp_source.list

rm -fr ${TEMP_SOURCES_BASE}.*
mkdir $TEMP_SOURCES_LIST_D

echo -e "\n## /etc/apt/sources.list.d/mx.list" | tee  $TEMP_SOURCES_LIST
echo -e "## mx-testrepo" | tee -a $TEMP_SOURCES_LIST
cat /etc/apt/sources.list.d/mx.list | grep -m1 -E "^#[[:space:]]+(deb https?.*mx/testrepo.*)" |  grep -o -E "(deb https?.*mx/testrepo.*)" | tee -a $TEMP_SOURCES_LIST

APT_OPTION="-o Dir::Etc::sourcelist=$TEMP_SOURCES_LIST"
[ "$ACTION" = "update" ] && APT_OPTION="-o Dir::Etc::sourceparts=- -o APT::Get::List-Cleanup=0 $APT_OPTION"


echo sudo apt $APT_OPTION "${@}"
sudo apt $APT_OPTION "${@}"

################################################
exit
################################################
Pretty cool solution! Just tried it and works great! :happy: Thanks for sharing! By the way, Sayonara has nothing to offer over Clementine. I thought it might be something like guayadeque player maybe a little better but...haven't played that much with it but still...so far not impressed.
Without each other's help there ain't no hope for us :happy:

philotux
Posts: 280
Joined: Sun Apr 22, 2018 12:57 pm

Re: (Solved) WARNING:root:could not open file '/etc/apt/sources.list'

#26 Post by philotux »

fehlix wrote: Fri Feb 01, 2019 6:01 pm I do use a little apt trick to use an addtional temporary source.list files for mx testrepo.

Code: Select all

apttestrepo 
is phenomenal!

Code: Select all

sudo apttestrepo update
## /etc/apt/sources.list.d/mx.list
## mx-testrepo
deb http://nl.mxrepo.com/mx/testrepo/ stretch test 
...
Reading state information... Done
126 packages can be upgraded. Run 'apt list --upgradable' to see them.

Code: Select all

sudo apt update
...
Reading state information... Done
All packages are up to date.
Thank you, fehlix!

:puppy:

User avatar
fehlix
Developer
Posts: 10381
Joined: Wed Apr 11, 2018 5:09 pm

Re: (Solved) WARNING:root:could not open file '/etc/apt/sources.list'

#27 Post by fehlix »

philotux wrote: Sat Feb 02, 2019 7:34 pm Thank you, fehlix!
Thanks, you for letting me know. I'm running it for couple of mounth now, and it as prooven to work
in harmony with apt. Sure it might be possibly get enhanced by adding other cli tools like apt-get, dpkg etc.
But it's good to know that somehow else finds it usefull too.
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

philotux
Posts: 280
Joined: Sun Apr 22, 2018 12:57 pm

Re: (Solved) WARNING:root:could not open file '/etc/apt/sources.list'

#28 Post by philotux »

fehlix wrote: Sat Feb 02, 2019 7:41 pm Sure it might be possibly get enhanced by adding other cli tools like apt-get, dpkg etc.
But it's good to know that somehow else finds it usefull too.
Sure. It's already such a nice tool and if you find time to make those additions, that will make it even more phenomenal.

Thanks again and best of luck!
philotux
:happy:

User avatar
asqwerth
Developer
Posts: 7231
Joined: Sun May 27, 2007 5:37 am

Re: (Solved) WARNING:root:could not open file '/etc/apt/sources.list'

#29 Post by asqwerth »

Moltke wrote: Sat Feb 02, 2019 2:13 pm

... By the way, Sayonara has nothing to offer over Clementine. I thought it might be something like guayadeque player maybe a little better but...haven't played that much with it but still...so far not impressed.
Have you tried lollypop?
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

User avatar
KoO
Posts: 491
Joined: Fri Feb 10, 2017 1:21 am

Re: (Solved) WARNING:root:could not open file '/etc/apt/sources.list'

#30 Post by KoO »

Quod Libet is a nice player. 4.2 is in MX test repo
Main : MX 19.1-AHS (i3) 5.4.13-1~mx19+1, Asus B450-i AMD 5 3600 , 32gb Hyper-X 3200 , GTX970 . :linuxlove:
Lenovo T430 : Debian10 antiX17 (i3) , 4.20.12 , i5 , 12gb .
Lenovo X220 : Test Machine (ATM)

Post Reply

Return to “General”