kottasのブログ

主に環境設定に関するメモを記載していきます。

GitLabのインストールでcurl: (35) エラー

はじめに

Gitlabをインストールしようと、公式のチュートリアルを進めていたのだが、

  1. Add the GitLab package repository and install the package Add the GitLab package repository. curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash

を実行したところ、

Installing /etc/apt/sources.list.d/gitlab_gitlab-ce.list...curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number curl is unable to connect to packagecloud.io over TLS when running: curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/config_file.list?os=Ubuntu&dist=bionic&source=script This is usually due to one of two things:

1.) Missing CA root certificates (make sure the ca-certificates package is installed) 2.) An old version of libssl. Try upgrading libssl on your system to a more recent version

と、なんかエラー出た。

about.gitlab.com

環境

Ubuntu 18.04

対策

おそらく “1.) Missing CA root certificates (make sure the ca-certificates package is installed)”が原因だとおもうので、暫定対応だが、上記のスクリプトをダウンロードし、上記のスクリプトcurlのコマンドを編集して、事なきを得た。
本当はちゃんと証明書関連の設定をすべき。

スクリプトのダウンロード。

wget https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh

スクリプト(script.deb.sh)の137行目を以下のように編集。

curl -x [PROXY] --insecure "${apt_config_url}" > $apt_source_path

スクリプト(script.deb.sh)の実行。

sudo bash script.deb.sh 

でOK。

参考

stackoverflow.com stackoverflow.com

PythonでSSLCertVerificationError

はじめに

タイトルの通り。

エラー
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1056)
対策1

Python2.7.9以降から、SSL証明書が正しくない場合、デフォルトでエラーを出すらしい。本質対策ではないが、以下のコードを書けば、動く。

import ssl
ssl._create_default_https_context = ssl._create_unverified_context
参考

qiita.com qiita.com shinespark.hatenablog.com

UbuntuにインストールしたAnacondaへのプロキシの通し方

はじめに

タイトルの通り。

環境

Ubuntu 18.04

コマンドラインから

4.4.x.以降で以下が可能らしい。

conda config --set proxy_servers.http http://"hogehoge":port
conda config --set proxy_servers.https https://""fugafuga:port
condarc に記載
proxy_servers:
    http: http://"hogehoge":port
    https: https://"fugafuga":port
確認
conda config --show
参考

https://stackoverflow.com/questions/31099279/running-conda-with-proxy stackoverflow.com qiita.com

UbuntuへNVIDIAのドライバを入れる際の注意点

はじめに

表題の通り。

環境
注意点
  • ドライバの選択とインストール
  • nouveau の停止
  • Secure Bootのオフまたは鍵の設定
  • その他
ドライバの選択とインストール

適切なドライバの確認。

ubuntu-drivers devices

上記で確認したコマンドのバージョンを指定し、以下を実行。

sudo apt install nvidia-driver-"上記コマンドで出てきたバージョン"

あるいは、Nvidiaの公式から対応するドライバをダウンロードしてきて、インストールしてもよい。 または、以下でドライバをオートでインストールができる。

sudo ubuntu-drivers autoinstall
nouveau の停止

デフォルトで nouveau というドライバが使用されており、それが競合してしまう可能性があるらしいので、 nouveau を停止させる。 以下、nouveauとは(wikiより)。

nouveau(ヌーヴォー)は X.Org Foundation と freedesktop.org のプロジェクトである。当初は、フリーでオープンソースではあるが、ソースコードがややこしく2D機能のみの "nv" ドライバーに基づくものだった。 現在は NVIDIAプロプライエタリLinux 用ドライバをリバースエンジニアリングして、 NVIDIAビデオカード用のフリーなドライバを開発することを狙いとしている。

nouveau の存在確認。

lsmod | grep -i nouveau

以下を、“/etc/modprobe.d/blacklist-nouveau.conf”に記載。

blacklist nouveau
options nouveau modeset=0

カーネルモジュールをブラックリストに追加し、再読み込み。

sudo update-initramfs -u
Secure Bootのオフまたは鍵の設定

Secure Bootのオフは以下をしてリブート。 カーネルで、署名なしドライバを読み込めるように設定を変える。パスワードを設定する必要あり。

sudo apt install mokutil
sudo mokutil --disable-validation

リブート後、いろいろ聞かれるので、オフにする。設定したパスワードが必要。

鍵の設定は、以下を参照。 qiita.com

その他

ドライバのインストール時に“5%”でビルドが止まってしまう問題。
バグらしいが、パスワードが本来は聞かれているらしい。パスを何回か入れれば次に進む。

参考

以上。

apt-get update で 'Origin' value from 'Google, Inc.' to 'Google LLC' でエラー

はじめに

表題の通り。 chrome のアップデートがうまくいかなかった?

apt-get update

をしたら、

E: Repository 'http://dl.google.com/linux/chrome/deb stable Release' changed its 'Origin' value from 'Google, Inc.' to 'Google LLC'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

でエラー。

環境
対策
sudo apt update
sudo apt-get upgrade

以上。