How can I Iinstall a package on Travis-ci with sudo:false in travis.yml ?
I have my travis.yml :
sudo: false
install:
- wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu52_52.1-3ubuntu0.4_amd64.deb
- sudo dpkg -i libicu52_52.1-3ubuntu0.4_amd64.deb
I have an error :
sudo: must be setuid root
The command "sudo dpkg -i libicu52_52.1-3ubuntu0.4_amd64.deb" failed and exited with 1 during .
Yes you can, at least some.
Travis has a whitelist of allowed packages you can install from using the containerised environment. Instead of using wget and dpkg, or apt, you define the packages in your yaml under the addons
section. Check https://docs.travis-ci.com/user/installing-dependencies/.
In the yaml you'd have something like:
addons:
apt:
packages:
- ncftp
ncftp
is whitelisted here.
If you need packages which are not whitelisted, you can set sudo: true
and your build will be launched in a non-containerised environment, so you have root (sudo
) access to install whatever you want. Alternatively you can raise an issue on their Github to add a whitelist for your package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With