Yanyg - Software Engineer

LINUX开发环境初始化

目录

1 Debian

1.2 install

sudo cp debian-10.6.0-amd64-DVD-1.iso /dev/sdc
sudo sync
sudo eject /dev/sdc
  • insert usb stick and loader from usb
  • select install(not graphical install)

2 System config

  • download from github:
~$ git clone [email protected]:yygcode/system-config
~$ cd system-config
~$ ./install.sh -f
### -f means force overwrite file if exist

3 Keymap

Change Caps and Ctrl:

3.1 vconsole

~$ cat ~/Caps2Ctrl.map
keymaps 0-127
keycode 58 = Control
keycode 29 = Caps_Lock
~$ sudo loadkeys ~/Caps2Ctrl.map

3.2 gnome

  • Search 'tweak' -> 'Keyboard & mouse' set Caps Behavior

4 terminator

  • install terminator and set shortcut
~$ sudo apt-get install terminator
  • Set shortcut
    • Search 'Keyboard' in gnome, Select keyboard to add additional shortcuts

5 base install

yes | sudo apt-get install gcc tmux terminator manpages manpages-dev manpages-zh manpages-posix manpages-posix-dev      gconf-service gconf2-common libappindicator1 libdbusmenu-glib4            libdbusmenu-gtk4 libgconf-2-4 libindicator7            libappindicator3-0.1-cil ntp            autoconf automake libtool cmake info texinfo texi2html gettext            gettext-doc autopoint libasprintf-dev libgettextpo-dev            libxaw7-dev libxaw3dxft8-dev libxaw-doc libxt-doc            libx11-dev libgtk3.0-cil-dev libwxgtk3.0-dev            libgnutls28-dev libtiff5-dev giflib-tools libgif-dev libjpeg-dev            gmp-doc libgmp10-doc libmpfr-dev gnutls-doc gnutls-bin liblzma-doc            libtinfo-dev libncursesw5-dev libncurses5-dev            mailutils mailutils-doc xaw3dg-dev libcairo2-dev librsvg2-dev            liblcms2-dev imagemagick libmagick++-dev            libdbus-1-dev libdbus-glib-1-dev libdbus-c++-dev gconf2            libgconf2-dev libm17n-dev libotf-dev libxft-dev libcairo2-dev            gir1.2-poppler-0.18 libpoppler-dev libpoppler-glib-dev            libpoppler-dev libpoppler-glib-dev libpoppler-private-dev            global fcitx-googlepinyin            fonts-arphic-bkai00mp fonts-arphic-bsmi00lp            fonts-arphic-gbsn00lp fonts-arphic-gkai00mp fonts-arphic-ukai            rdesktop mplayer ffmpeg vlc  mjpegtools

6 google chrome

~$ sudo apt-get install fonts-liberation libappindicator3-1
~$ sudo dpkg -i google-chrome-stable_current_amd64.deb
~$ sudo apt --fix-broken install # run if fail

7 fcitx

  • Run dpkg to add locales
~$ sudo dpkg-reconfigure locales
## Select en_US.UTF-8, zh_CN.UTF-8
  • Run Fcitx Configuration
    • Input method add and disable 'Only show current language'
    • Input method add 'Google pinyin'
    • Global config, Trigger input method set to 'Ctrl-Alt-Space'
  • Reboot
  • Try 'Ctrl-Alt-Space' switch to google-pinyin

8 emacs

  • download and compile
~$ git clone https://git.savannah.gnu.org/git/emacs.git
~$ cd emacs
~$ git checkout emacs-27.1
~$ ./configure --without-pop --with-mailutils
~$ make -j2 && sudo make install
  • config
~$ [email protected]:yygcode/.emacs.d
# Use https if you are not contributor:
~$ https://github.com/yygcode/.emacs.d.git
  • Start emacs
    • MAY need restart multi times
  • Need set LANG=zh_CN.UTF-8 if start emacs in X windows
  • Run emacs daemon
~$ emacs --daemon

9 gcc and g++ manpages

9.1 gcc

debian8还没有gcc-doc,可以用之前版本的,把下列两行加到/etc/apt/sources.list:

deb http://deb.debian.org/debian buster-backports main contrib non-free
deb-src http://deb.debian.org/debian buster-backports main contrib non-free

执行update然后install:

~$ sudo apt update
~$ sudo apt install -t buster-backports gcc-doc

9.2 g++

下载manpages,解压到 /usr/share/man/man3/目录:

~$ wget --continue ftp://gcc.gnu.org/pub/gcc/libstdc++/doxygen//libstdc++-man.4.4.0.tar.bz2
~$ tar xvf libstdc++-man.4.4.0.tar.bz2
~$ cd libstdc++-man.4.4.0
~$ cp man3/* /usr/share/man/man3/

试试:man std::iostream.