following solution does not work if my dependencies need the same base library.
To run my RSpec tests I need to install the same gems but if we use the previous solution to change source library it doesn’t support base Debian image. So I used the following solution,
name: Fix circleci issue with jessie-update binary list on 20180326
command: |
cat /dev/null > /etc/apt/sources.list
echo "deb http://archive.debian.org/debian/ jessie main" | tee -a /etc/apt/sources.list
apt-get update
Added following line to just remove all other source libraries and keep only jessie main base library.
#!/bin/bash -eo pipefail cat /dev/null > /etc/apt/sources.list echo "deb http://archive.debian.org/debian/ jessie main" | tee -a /etc/apt/sources.list sudo apt-get update
/bin/bash: /etc/apt/sources.list: Permission denied Exited with code 1
so seems like i do not have permission to edit /etc/apt/sources.list. did you use your solution as is or did you circumvent the permission-problem i’m having somehow?
@gnak are you trying to do with any bash script or have you added this in circleci config.yml file?? will you be able to share your configuration file here ?? Thanks
@gnak my solution is simple just add my step before you use apt-get update in yours .circleci/config.yml file. (correct me if I am wrong) by default cercleci runs all steps with root previledge so no need to use sudo. For better understanding if possible please share your config.yml file. Thanks
@gnak One thing try to remove sudo from all steps and check…if not worked then rerun your job with SSH , SSH to CircleCi container and try to debug permissions to source.list file try if you can use sudo inside container or not also check sudo permissions to /etc/sudoers then you will know root cause. Feel free to reach me. Thanks.
- run:
name: Fix circleci issue with jessie-update binary list on 20180326
command: |
sudo chmod 646 /etc/apt/sources.list
cat /dev/null > /etc/apt/sources.list
echo "deb http://archive.debian.org/debian/ jessie main" | tee -a /etc/apt/sources.list
The diff from previous attempts is the line sudo chmod 646 /etc/apt/sources.list.
I solved it by SSHing into the container. whoami => circleci
I checked ls -la on sources.list. permissions: -rw-r--r--
owner is root circleci is not in group, so changed permissions to -rw-r--rw-.