Can not write log, openpty() failed (/dev/pts not mounted?)
Jing, mqjing@gmail.com
ETA: 5 mins
On-line Version: (view)
當你進入 chroot 環境安裝軟體時, 很多人會遇到這個 warning message. 關鍵在於你的 chroot 環境裡面沒有提供 dev/pts. 所以下面是一種解決方法.
Reproduce Step
Step 1: Enter chroot
sudo chroot ~/chroot/chroot-amd64-ubuntu10.04/
Step 2: Install daemon package
apt-get install daemon
(# dpkg --remove daemon)
Got Error Message
(sqm-android-lucid)root@jing-XPS-L412Z:/# apt-get install daemon
Reading package lists... Done
Building dependency tree
Reading state information... Done
daemon is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 98 not upgraded.
(sqm-android-lucid)root@jing-XPS-L412Z:/# dpkg --remove daemon
(Reading database ... 22565 files and directories currently installed.)
Removing daemon ...
(sqm-android-lucid)root@jing-XPS-L412Z:/# apt-get install daemon
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
daemon
0 upgraded, 1 newly installed, 0 to remove and 98 not upgraded.
Need to get 0B/97.4kB of archives.
After this operation, 283kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
daemon
Install these packages without verification [y/N]? y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_TIME = "zh_TW.UTF-8",
LC_MONETARY = "zh_TW.UTF-8",
LC_ADDRESS = "zh_TW.UTF-8",
LC_TELEPHONE = "zh_TW.UTF-8",
LC_NAME = "zh_TW.UTF-8",
LC_MEASUREMENT = "zh_TW.UTF-8",
LC_IDENTIFICATION = "zh_TW.UTF-8",
LC_NUMERIC = "zh_TW.UTF-8",
LC_PAPER = "zh_TW.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
debconf: delaying package configuration, since apt-utils is not installed
Can not write log, openpty() failed (/dev/pts not mounted?)
Selecting previously deselected package daemon.
(Reading database ... 22558 files and directories currently installed.)
Unpacking daemon (from .../daemon_0.6.4-1_amd64.deb) ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Setting up daemon (0.6.4-1) ...
|
Solution
sudo mount --bind /dev ~/chroot/chroot-amd64-ubuntu10.04/dev
sudo mount --bind /dev/pts ~/chroot/chroot-amd64-ubuntu10.04/dev/pts
sudo mount --bind /proc ~/chroot/chroot-amd64-ubuntu10.04/proc/
sudo mount --bind /sys ~/chroot/chroot-amd64-ubuntu10.04/sys
|
Reference
- http://forum.xda-developers.com/showthread.php?t=890253