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?

Alma Linux 9.4 に GNU screen-5.0.0 をインストール

Last updated at Posted at 2024-09-14

https://security.opensuse.org/2025/05/12/screen-security-issues.html
5.0.0 にはセキュリティーホールが見つかり、5.0.1 がリリースされています。
バージョンを確認して最新を入れるようにしましょう。

事前、必要なパッケージをインストールする

  • 必要なライブラリをダウンロード
dnf -y install gcc make autoconf automake pam-devel
setenv CFLAGS '-mtune=native -march=native'
setenv LDFLAGS -L/usr/local/lib

/usr/local/lib のライブラリを読み込むようにする

今回は /usr/local 以下にインストールするのでライブラリの読み込み先を追加

cat <<__EOF__>/etc/ld.so.conf.d/local.conf
/usr/local/lib/
__EOF__
ldconfig

パッケージの物は古いので最新のビルドツールをインストール

autoconf をインストール

curl -O https://repo.jing.rocks/gnu/autoconf/autoconf-2.72.tar.xz
tar xaf autoconf-2.72.tar.xz && cd autoconf-2.72
./configure --prefix=/usr/local && make install
cd ..
rm -rf autoconf-2.72*

automake をインストール

curl -O https://repo.jing.rocks/gnu/automake/automake-1.17.tar.xz
tar xaf automake-1.17.tar.xz && cd automake-1.17
./configure --prefix=/usr/local && make install
cd ..
rm -rf automake-1.17*

libtool をインストール

curl -O https://repo.jing.rocks/gnu/libtool/libtool-2.4.7.tar.xz
tar xaf libtool-2.4.7.tar.xz && cd libtool-2.4.7
./configure --prefix=/usr/local && make install
cd ..
rm -rf libtool-2.4.7*

もう要らないパッケージを削除

dnf -y remove autoconf automake libtool

termcap パッケージをインストール

curl -O https://repo.jing.rocks/gnu/termcap/termcap-1.3.1.tar.gz
tar xzf termcap-1.3.1.tar.gz && cd termcap-1.3.1
./configure --prefix=/usr/local --enable-install-termcap && make -j install
cd ..
rm -rf termcap-1.3.1*

古いので ncurses もアップデート

curl -O https://repo.jing.rocks/gnu/ncurses/ncurses-6.5.tar.gz
tar xzf ncurses-6.5.tar.gz && cd ncurses-6.5

./configure --prefix=/usr/local --with-libtool --with-normal --enable-termcap --enable-ext-colors --enable-colorfgbg --enable-fvisibility && make -j install distclean
./configure --prefix=/usr/local --with-libtool --with-shared --enable-termcap --enable-ext-colors --enable-colorfgbg --enable-fvisibility && make -j install

cd ..
rm -rf ncurses-6.5*

screen コマンドをインストール

何故かリンクに失敗するので ldconfig でライブラリの情報を更新して -lncursesw を手動で追加する。

ldconfig
setenv LIBS '-lncursesw'
curl -O https://repo.jing.rocks/gnu/screen/screen-5.0.0.tar.gz
tar xaf screen-5.0.0.tar.gz && cd screen-5.0.0
./autogen.sh
./configure --prefix=/usr/local --enable-telnet --with-system_screenrc=/usr/local/etc/screenrc && make -j install
cd ..
rm -rf screen-5.0.0*

ライブラリの読み込み先を確認

リンクに失敗して場当たり的な対応をしたので一応確認しておく。

ldd /usr/local/bin/screen
        linux-vdso.so.1 (0x00007ffefa563000)
        libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007fb435819000)
        libncursesw.so.6 => /usr/local/lib/libncursesw.so.6 (0x00007fb435796000)
        libpam.so.0 => /lib64/libpam.so.0 (0x00007fb435784000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fb435400000)
        libaudit.so.1 => /lib64/libaudit.so.1 (0x00007fb435755000)
        libeconf.so.0 => /lib64/libeconf.so.0 (0x00007fb43574a000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fb43566d000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb435860000)
        libcap-ng.so.0 => /lib64/libcap-ng.so.0 (0x00007fb435664000)

ちゃんと /usr/local の下のライブラリをリンクしてますね。良かった良かった。

termcap DB をインストール

ncursesw 経由で termcap に依存している気がするので

mkdir -p /usr/local/etc
curl https://invisible-island.net/datafiles/current/termcap.src.gz | gzip -dc - > /usr/local/etc/termcap

この termcap には putty 用や、TeraTerm 用の定義があるので TERM 変数を
putty を使うときは setenv TERM putty-256color
screen に入ったときはscreen.putty-256color

TeraTerm なら setenv TERM teraterm-256color
screen に入ったときは screen.teraterm
にするとよいでしょう。

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?