0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntu カスタムリポジトリ セットアップ手順

Posted at

背景

Ubuntu 18.04のcmakeのバージョンが古いので、最新版のパッケージを利用するためにカスタムリポジトリを作成する。

環境

  • Ubuntu 18.04.5
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

セットアップ手順

事前準備

$ sudo apt -y install dpkg-dev

リポジトリ用ディレクトリ作成

$ sudo mkdir /home/customdpkgs
$ cd /home/customdpkgs

パッケージ配置

$ sudo cmake_3.19.7_amd64.deb /home/customdpkgs/

パッケージのスキャン

$ sudo dpkg-scanpackages . | gzip > Packages.gz

ソースリスト作成

$ sudo vi /etc/apt/sources.list.d/customdpkgs.list
$ cat /etc/apt/sources.list.d/customdpkgs.list
deb [trusted=yes] file:///home/customdpkgs ./

アップデート

$ sudo apt -y update
$ sudo apt -y install cmake
$ cmake --version
cmake version 3.19.7

参考文献

以下の文献の dpkg-scanpackages コマンドでは成功した。
https://wiki.debian.org/DebianRepository/Setup#dpkg-scanpackages_and_dpkg-scansources

以下の文献の dpkg-scanpackages コマンドでは apt update で失敗した。
https://www.percona.com/blog/2020/01/02/how-to-create-your-own-repositories-for-packages/

エラーメッセージは以下の通り。

Reading package lists... Error!
E: Read error - read (21: Is a directory)
E: The package lists or status file could not be parsed or opened.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?