顯示具有 Ubuntu 標籤的文章。 顯示所有文章
顯示具有 Ubuntu 標籤的文章。 顯示所有文章

2019年8月23日 星期五

[ubuntu] gcin 的詞庫編輯 無法使用 libcurl.so.4: version `CURL_OPENSSL_3' not found (required by ts-edit)

[ubuntu] gcin 的詞庫編輯 無法使用 libcurl.so.4: version `CURL_OPENSSL_3' not found (required by ts-edit)

在新加詞庫時,發現 詞庫編輯無法是用,
後來發現,原來是 libcurl.so.4: version `CURL_OPENSSL_3' not found 的問題

ts-edit: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by ts-edit)

sudo apt-get install libcurl3

Ubuntu的版本是
 lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

2019年2月14日 星期四

[linux] ubuntu 18.04 pip install M2Crypto SWIG/_m2crypto_wrap.c:3557:10: fatal error: openssl/err.h: No such file or directory

[linux] ubuntu 18.04 pip install M2Crypto SWIG/_m2crypto_wrap.c:3557:10: fatal error: openssl/err.h: No such file or directory

pip install M2Crypto 時發生下面 error

SWIG/_m2crypto_wrap.c:3557:10: fatal error: openssl/err.h: No such file or directory

sudo apt-get install swig
sudo apt-get install libssl1.0-dev

pip install M2Crypto==0.24.0

```
swig - Generate scripting interfaces to C/C++ code
libssl1.0-dev - Secure Sockets Layer toolkit - development files
```

ref:
Trouble installing m2crypto with pip on OS X / macOS - Stack Overflow https://stackoverflow.com/questions/33005354/trouble-installing-m2crypto-with-pip-on-os-x-macos

2019年2月13日 星期三

[linux] 沒有聲音時 pulseaudio -k

[linux] 沒有聲音時 pulseaudio -k

播放聲音時若發現沒有聲音,
可以使用 pulseaudio -k ,去 kill PulseAudio daemon 。

pulseaudio -k && sudo alsa force-reload

PulseAudio  is  a  networked low-latency sound server for Linux, POSIX and Windows
       systems.

       -k | --kill
              Kill  an  already running PulseAudio daemon of the calling user (Equivalent
              to sending a SIGTERM).

[SOLVED] audio problem, only see dummy output https://ubuntuforums.org/showthread.php?t=2309373

[linux] 如何在 Linux 中 使用 terminator 如 iterm2 右鍵複製貼上

[linux] 如何在 Linux 中 使用 terminator 如 iterm2 右鍵複製貼上

terminator 按右鍵
profile  copy on selection
如果要右鍵直接貼上,就是
勾選 putty style paste

這樣右鍵選出要使用滑鼠中鍵加上 shift才會喚起


ref:
A terminal which provides select-to-copy and right-click-to-paste - Ask Ubuntu https://askubuntu.com/questions/211292/a-terminal-which-provides-select-to-copy-and-right-click-to-paste

2019年1月10日 星期四

[ubuntu][LXDE][openbox] 使用 xcompmgr 與 transset 設定視窗透明度



使用 LXDE 怎麼 設定 windows 的透明度呢?
因為 LXDE 使用了 openbox ,
可以使用 xcompmgr 與 transset

本來在使用 transset 指令時,就會出現一個點選指標,可以選一個,想要透明的視窗。
預設的值是 0.75。
在指令後加上參數,改變透明度 為 0.5 。
$ transset 0.5                         
Set Property to 0.5

在使用時,必須先啟動 xcompmgr
xcompmgr - sample X compositing manager

$ xcompmgr -c

在lxsession LXDE 中,加入 autostart 中 @xcompmgr -c
± % ps aux | grep lxsession                                   
peicheng 18444  0.0  0.0 466744  6856 ?        Ssl   2018   1:10 /usr/bin/lxsession -s LXDE -e LXDE

確認使用哪個 lxsession config
vim ~/.config/lxsession/LXDE/autostart

cat ~/.config/lxsession/LXDE/autostart                                            !11389
@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@xscreensaver -no-splash
@xcompmgr -c


2018年8月13日 星期一

[linux] Ubuntu 沒有聲音 使用 chrome 與 opera 播 youtube 不會跑 How To Fix: No Sound In Ubuntu And Linux

Ubuntu 中 發現沒有聲音
使用 chrome 與 opera 播 youtube 都停止不會跑,
後來發現是沒有聲音的影響。

可以先使用 alsa 的 force reload 試看看

$ sudo alsa force-reload
Terminating processes: 18613.
Unloading ALSA sound driver modules: snd-hda-codec-hdmi snd-hda-codec-realtek snd-hda-codec-generic snd-hda-intel snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-seq-midi snd-seq-midi-event snd-rawmidi snd-seq snd-seq-device snd-timer (failed: modules still loaded: snd-hda-codec-hdmi snd-hda-codec-realtek snd-hda-codec-generic snd-hda-intel snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-timer).
Loading ALSA sound driver modules: snd-hda-codec-hdmi snd-hda-codec-realtek snd-hda-codec-generic snd-hda-intel snd-hda-codec snd-hda-core snd-hwdep snd-pcm snd-seq-midi snd-seq-midi-event snd-rawmidi snd-seq snd-seq-device snd-timer.

2018年6月30日 星期六

[linux][ubuntu] mpv: symbol lookup error: mpv: undefined symbol: ass_set_check_readorder


安裝完 MPV 後,執行時發現下面錯誤

mpv: symbol lookup error: mpv: undefined symbol: ass_set_check_readorder

更新完 libass5 後就正常了。

sudo apt-cache search libass5                                                                !10027
libass5 - library for SSA/ASS subtitles rendering


% sudo apt-get install libass5

Startup error: mpv: undefined symbol: ass_set_check_readordere · Issue #3344 · mpv-player/mpv https://github.com/mpv-player/mpv/issues/3344

2018年3月28日 星期三

[ubuntu] Ubuntu 16.04 install php7.0 solve dpkg: error processing package php7.0-common (--configure): post-installation script


因為更新完ubuntu 系統,使用php-cs-fixer 出現 PHP Fatal error: Call to undefined function json_decode() 錯誤。
使用 php -m 看一下是不是特定module沒有載入。

% php -m                                                                                                                                                                         
[PHP Modules]
calendar
Core
ctype
date
exif
fileinfo
filter
ftp
gettext
hash
iconv
libxml
openssl
pcntl
pcre
PDO
Phar
posix

[Zend Modules]

看的出來並沒有載入 json module

$sudo apt-cache search php7.0 | grep json                                                                                                                                            
php7.0-json - JSON module for PHP
$sudo apt-get install php7.0-json

結果出現了
dpkg: error processing package php7.0-common (--configure): post-installation script  

嘗試過很多方法最後
apt purge apache2*
apt purge php*
rm -rf /etc/apache2 /etc/php

root@pccm:/var/lib/dpkg/info# rm -rf ./*
root@pccm:/var/lib/dpkg/info# apt-get install --reinstall php7.0
root@pccm:/var/lib/dpkg/info# php --ini
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File:         (none)
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed:      (none)
root@pccm:/var/lib/dpkg/info# php --ini
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File:         /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed:      (none)

這裡個 ini 檔是從 /usr/lib/php/7.0 複製到對應路徑的
php-cli 會在每次使用載入module ,php -m 看看有無載入module 。
如果沒有再檢查 php.ini 的設定
# vim /etc/php/7.0/cli/php.ini
加入

root@pccm:/etc/php/7.0/cli# cat php.ini  | grep "^extension"
extension=calendar.so
extension=ctype.so
extension=exif.so
extension=fileinfo.so
extension=ftp.so
extension=gettext.so
extension=iconv.so
extension=json.so
extension=pdo.so
extension=phar.so
extension=posix.so
extension=readline.so
extension=shmop.so
extension=sockets.so
extension=sysvmsg.so
extension=sysvsem.so
extension=sysvshm.so
extension=tokenizer.so

在使用php -m 就會看到載入的module了

root@pccm:/etc/php/7.0/cli# php -m
[PHP Modules]
calendar
Core
ctype
date
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
zlib

[Zend Modules]

2018年3月12日 星期一

[ubuntu] How to restart X windows 怎麼重新啟動 X Windows


[ubuntu] How to restart X windows 怎麼重新啟動 X Windows
X windows 因為莫名原因卡住的時候,可以在 terminal 中去重新 x windows
ctrl + alt + 1 後,會出現console 。要知道使用哪個 windows manager 呢?目前16.04 Ubuntu 使用的預設 X display manager 是 LightDM LightDM - Wikipedia https://en.wikipedia.org/wiki/LightDM
% cat /etc/X11/default-display-manager /usr/sbin/lightdm


重新啟動 X windows manager /etc/init.d/lightdm restart

2018年1月5日 星期五

[linux] /usr/bin/ld: cannot find -lopencv_imgcodecs 解決

編譯程式的時候出現
/usr/bin/ld: cannot find -lopencv_imgcodecs

$ make
g++ -std=c++11 -O3 -I.. ../dlib/all/source.cpp -lpthread -lX11 -ljpeg -lpng -DDLIB_JPEG_SUPPORT -DDLIB_PNG_SUPPORT -c dnn_mmod_dog_hipsterizer_2.cpp
g++ -std=c++11 -O3 -I.. ../dlib/all/source.cpp -lpthread -lX11 -ljpeg -lpng -DDLIB_JPEG_SUPPORT -DDLIB_PNG_SUPPORT data.grpc.pb.o data.pb.o dnn_mmod_dog_hipsterizer_2.o -L/usr/local/lib -L/lib/x86_64-linux-gnu `pkg-config --libs grpc++ grpc` -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -lprotobuf -lpthread -ldl -lssl -ldlib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -o server
/usr/bin/ld: cannot find -lopencv_imgcodecs
collect2: error: ld returned 1 exit status
makefile:12: recipe for target 'server' failed
make: *** [server] Error 1

原來是 opencv_imgcodecs 是在 opencv 3.0+ 才有提供

安裝完 opencv 3.0+ 就可以編譯了。
參考 Ubuntu上安裝 OpenCV
http://peichengnote.blogspot.com/2018/01/ubuntu-build-and-install-opencv-on.html





ref
problem.. /usr/bin/ld: cannot find -lopencv_imgcodecs · Issue #4942 · BVLC/caffe https://github.com/BVLC/caffe/issues/4942

[ubuntu] build and install opencv on ubuntu Ubuntu 怎麼安裝 OpenCV


build and install opencv on ubuntu在 Ubuntu 怎麼安裝 OpenCV  
git clone https://github.com/opencv/opencv.git
cd opencv
mkdir build
cmake ..
make all -j$(nproc)
sudo make install

2018年1月4日 星期四

[ubuntu][linux] jpeglib.h: No such file or directory 解決方法


jpeglib.h: No such file or directory
ubuntu 中,編譯程式出現 jpeglib.h: No such file or directory少裝了 libjpeg header ,可以使用:

sudo apt-get install libjpeg-dev

2018年1月3日 星期三

[linux] g++ -lssl error:"collect2: ld returned 1 exit status" Solve


ubuntu 中使用 g++ 編譯程式出現
g++ -lssl error:"collect2: ld returned 1 exit status"

$ sudo apt-cache search libssl
[sudo] password for peicheng:
libssl-dev - Secure Sockets Layer toolkit - development files
libssl-doc - Secure Sockets Layer toolkit - development documentation
libssl1.0.0 - Secure Sockets Layer toolkit - shared libraries
libssl1.0.0-dbg - Secure Sockets Layer toolkit - debug information
cl-plus-ssl - Common Lisp interface to OpenSSL
dcmtk - OFFIS DICOM toolkit command line utilities
dlang-openssl - D version of the C headers for openssl
libdcmtk-dev - OFFIS DICOM toolkit development libraries and headers
libdcmtk5 - OFFIS DICOM toolkit runtime libraries
libssl-ocaml - OCaml bindings for OpenSSL (runtime)
libssl-ocaml-dev - OCaml bindings for OpenSSL
libsslcommon2 - enterprise messaging system - common SSL libraries
libsslcommon2-dev - enterprise messaging system - common SSL development files

$ sudo apt-get install libssl1.0.0 libssl-dev -y

2017年5月3日 星期三

[linux] ubutnu 16.04 讀取 exfat


插入隨身碟後出現下列訊息

Command-line `mount -t "exfat" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,iocharset=utf8,namecase=0,errors=remount-ro,umask=0077" "/dev/sdg3" "/media/peicheng/Elements 2"' exited with non-zero exit status 32: mount: unknown filesystem type 'exfat'

Ubuntu 16.04 預設情況下,不能讀取 exfat ,install exfat 相關的 package 。
$ sudo apt install exfat-utils exfat-fuse

2016年12月6日 星期二

[docker] how to install docker on Ubuntu 16.04 如何在 Ubuntu 16.04 安裝 Docker



如何在  Ubuntu 16.04  安裝 Docker
在 EC2 上啟用了一台新的 instance ,透過下面步驟安裝 docker 的環境


  • uname -r
    確認一下  kernel version 是在 3.10 以上,不過這個在 16.04  上預設是必然的
  • sudo apt-get update
  • sudo apt-get install apt-transport-https ca-certificates
  • sudo apt-key adv                --keyserver hkp://ha.pool.sks-keyservers.net:80                --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
  • echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
    增加 source list 並且 更新
  • sudo apt-get update
  • apt-cache policy docker-engine
    驗證一下 apt 來源是否是正確的
  • sudo apt-get update
  • sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
  • sudo apt-get update
  • sudo apt-get install docker-engine
  • sudo service docker start
  • sudo docker run hello-world
  • sudo docker ps

2016年3月2日 星期三

[ubuntu] switch from ibus to gcin / 關閉 ibus 的方法



安裝完gcin 後可能會遇到預設還是ibus 的情形

sudo apt-get install  language-selector-gnome
/usr/bin/gnome-language-selector

把 鍵盤輸入法系統 從 ibus 改成 gcin  ,登出以後就會生效。




2015年1月28日 星期三

[linux] ubuntu 14.04 using LXDE as desktop enviriment



在 Ubunutu 14.04 改用 LXDE 來取代 Ubunut Unity

$ sudo apt-get install lxde

在 restart or logout

在 login 時點選 帳號旁邊的 ubuntu 符號 可以選擇現有的 Desktop Environment 當做這個帳號登入的桌面環境

如圖,
configuration - Switching window manager/desktop environments? - Ask Ubuntu
http://askubuntu.com/questions/162516/switching-window-manager-desktop-environments

如果不能點擊,可以先點另外一個帳號,再點回想要登入的帳號。

[linxu] LXDE change wallpaper command line



由於 LXDE 使用的是 pcmanfm ,

在command line 中可以使用

$ pcmanfm --set-wallpaper=/home/peicheng/1.jpg

來設定 wallpaper


2014年12月4日 星期四

[linux][ubuntu]W: GPG error



W: A error occurred during the signature verification.
The repository is not updated and the previous index files will be used. GPG error:http://extras.ubuntu.com quantal Release: 
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192

W: GPG error: http:// archive.canonical.com quantal Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32

在做 apt-get update 時,若出現  GPG key missing or GPG key error的狀況

先找到 error message 標示的 key 3B4FE6ACC0B21F32

#  gpg --keyserver pgpkeys.mit.edu --recv-key 3B4FE6ACC0B21F32
# gpg -a --export 3B4FE6ACC0B21F32 | apt-key add -


or 

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5

note.
後面標示的key 務必替換成 error message內的 key

2014年8月26日 星期二

[linux] ubuntu ssh slow appear



ubuntu ssh slow appear

在 ubuntu 上使用ssh 指令時,常常要等一陣子。
可以在 ssh時 使用-vvv option列出debug message。

debug2: bits set: 528/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/peicheng/.ssh/id_rsa (0x7f81c3da6ef0)
debug2: key: /home/peicheng/.ssh/id_dsa ((nil))
debug2: key: /home/peicheng/.ssh/id_ecdsa ((nil))
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/peicheng/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/peicheng/.ssh/id_dsa
debug3: no such identity: /home/peicheng/.ssh/id_dsa
debug1: Trying private key: /home/peicheng/.ssh/id_ecdsa
debug3: no such identity: /home/peicheng/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password


可能原因有 GSSAPIAuthentication,GSSAPIAuthentication fail 問題,
可以在 sudo vim /etc/ssh/ssh_config or ~/.ssh/config
加上
GSSAPIAuthentication no                                                                                          
GSSAPIDelegateCredentials no




Why ssh “password” prompt takes too long to appear? - Ask Ubuntu
http://askubuntu.com/questions/246323/why-ssh-password-prompt-takes-too-long-to-appear