Ub18.0.4安装及测试Conan2.0过程

安装artifactory 注意事项

  1. 保证8081 8082 8040 8046等端口不被占用
  2. 建好用户

sudo useradd -r -m -s /bin/bash artifactory

#查看

ls /home

#修改密码

sudo passwd artifactory

Password artifactory

#修改用户权限 增加w权限

sudo chmod +w /etc/sudoers

#打开权限文件并编辑

sudo vim /etc/sudoers

...

# User privilege specification

root    ALL=(ALL:ALL) ALL

user    ALL=(ALL:ALL) ALL

#在下列地方加上本次新增用户

artifactory ALL=(ALL:ALL) ALL

...

!wq保存退出

#去掉w权限

sudo chmod -w /etc/sudoers

3、安装过程查看日志

echo "deb https://releases.jfrog.io/artifactory/artifactory-pro-debs bionic main" | sudo tee -a /etc/apt/sources.list;

wget -qO - https://releases.jfrog.io/artifactory/api/gpg/key/public | sudo apt-key add -;

echo "deb https://releases.jfrog.io/artifactory/artifactory-pro-debs bionic main" | sudo tee -a /etc/apt/sources.list;

apt-get update;sudo apt-get install jfrog-artifactory-cpp-ce

根据日志赋值对应目录权限

sudo chown artifactory:artifactory  /opt/jfrog/ -R

sudo chown artifactory:artifactory  /opt/jfrog/artifactory/var/log/  -R

  1. 使用conda安装conan及运行依赖项

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && bash Miniconda3-latest-Linux-x86_64.sh

conda create --name conan python==3.8

conda update -n base conda

修改配置文件 .bashrc

添加项在末尾

conda activate conan

conda install conan -c conda-forge

conda update conan -c conda-forge

  1. 管理远端

# 添加源

conan remote add privrepo  http://192.168.1.229:8082/artifactory/api/conan/stable

# 或者使用insert来将其作为首个源

conan remote update privrepo http://192.168.1.229:8082/artifactory/api/conan/stable --insert=0

# 展示所有源

conan remote list

# 删除一个源

conan remote remove privrepo

# 指定源添加用户

conan remote set-user privrepo wellzhou

# 指定源进行登陆验证

conan remote auth privrepo  --with-user

# 查看源的用户列表

conan remote list-users

  1. 测试conan

创建测试项目

mkdir hellopkg && cd hellopkg

conan new cmake_lib -d name=hello -d version=0.1

安装最新版的cmake

sudo apt remove cmake

wget -q https://apt.kitware.com/kitware-archive.sh

chmod 755 kitware-archive.sh

sudo ./kitware-archive.sh

sudo apt-get install -y cmake

cmake --version

完成打包

conan create .

你可能感兴趣的:(linux,运维,服务器)