当前位置:   article > 正文

Kali Linux-装机后通用配置

sudo gesettings list-recursively

前言

本文主要介绍kali linux rolling版安装后的通用配置。包括网络优化,系统更新,显卡驱动安装,乱码问题解决方案,常用工具软件安装,键盘灯配置等。当前kali版本为2018.7,文章随时更新。
update:2019-04-08 17:24:40

一、 网络优化

更换host

wget https://raw.githubusercontent.com/googlehosts/hosts/master/hosts-files/hosts -O /etc/hosts

更换dns

  1. domain
  2. nameserver 1.1.1.1
  3. nameserver 1.0.0.1
  4. nameserver 9.9.9.9

当前版本不能直接编辑/etc/resolv.conf,需通过 resolvconf命令配置,最多可指定3个DNS服务器。

  1. sudo vi /etc/resolvconf/resolv.conf.d/head #另外还有base、tail几个文件可选
  2. sudo service resolvconf restart #手动重启服务
  3. sudo update-rc.d resolvconf enable #设为开机启动
  4. #可以通过如下方式验证是否生效
  5. cat /etc/resolv.conf

添加源

kali rolling现在的官方源会“智能”跳转到国内源,但速度实在不敢恭维。下面提供几个源地址,挑选一个最快的写到 /etc/apt/sources.list 里面。

  1. #官方源
  2. deb http://http.kali.org/kali kali-rolling main contrib non-free
  3. # For source package access, uncomment the following line
  4. # deb-src http://http.kali.org/kali kali-rol3ling main contrib non-free
  5. #浙大
  6. deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
  7. deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
  8. #东软
  9. deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
  10. deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
  11. # 阿里云
  12. deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
  13. deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
  14. deb http://mirrors.aliyun.com/kali-security kali-rolling/updates main contrib non-free
  15. deb-src http://mirrors.aliyun.com/kali-security kali-rolling/updates main contrib non-free
  16. # 中科大
  17. deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
  18. deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
  19. deb http://mirrors.ustc.edu.cn/kali-security kali-current/updates main contrib non-free
  20. deb-src http://mirrors.ustc.edu.cn/kali-security kali-current/updates main contrib non-free

如何判断哪个快?ping……

二、 更新系统

  1. apt-get update -y && apt-get dist-upgrade -y
  2. #reboot
  3. apt-get install linux-headers-$(uname -r)
  4. #reboot

有两处建议重启下,如果结束后提示--fix-missing相关字样,按照提示再运行一次,apt-get dist-upgrade --fix-missing -y。有些内容需要手动确认,根据实际情况按q,或者挪动方向键回车。

如果apt-get update出现GPG Error – Key Expired,需要更新一下gpg key。

  1. wget https://http.kali.org/kali/pool/main/k/kali-archive-keyring/kali-archive-keyring_2018.1_all.deb
  2. sudo dpkg -i kali-archive-keyring_2018.1_all.deb
  • 方案二
    sudo apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys 7D8D0BF6
  • 方案三
    wget -q -O - https://archive.kali.org/archive-key.asc |sudo apt-key add

三 、安装N卡驱动

网上关于"KALI LINUX NVIDIA显卡驱动"的帖子五花八门,踩了无数坑之后,才意识到RTFM的重要性。安装方法其实很简单,直接按照官方文档进行操作,GTX1070亲测有效。个别地方有小变动,但不影响安装。
注意几点:glxinfo需要手动安装,安装命令是:sudo apt-get install mesa-utils;查看是否开启渲染:glxinfo| grep -i "direct rendering";查看屏幕fps:glxgears

四、修复 add-apt-repository

根据官方的说法,由于kali是针对渗透测试进行了高度定制化的系统,采用add-apt-repository这种方式安装第三方软件容易导致系统不稳定。在漫长的源码编译和快速安装之间,总要有个取舍。自带的add-apt-repository是用python3写的,运行时各种报错。下面代码算是add-apt-repository命令的另一个版本的源码,可以写成脚本替换/usr/bin/add-apt-repository

  1. #!/bin/bash
  2. if [ $# -eq 1 ]
  3. NM=`uname -a && date`
  4. NAME=`echo $NM | md5sum | cut -f1 -d" "`
  5. then
  6. ppa_name=`echo "$1" | cut -d":" -f2 -s`
  7. if [ -z "$ppa_name" ]
  8. then
  9. echo "PPA name not found"
  10. echo "Utility to add PPA repositories in your debian machine"
  11. echo "$0 ppa:user/ppa-name"
  12. else
  13. echo "$ppa_name"
  14. echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu oneiric main " >> /etc/apt/sources.list
  15. apt-get update >> /dev/null 2> /tmp/${NAME}_apt_add_key.txt
  16. key=`cat /tmp/${NAME}_apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3`
  17. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
  18. rm -rf /tmp/${NAME}_apt_add_key.txt
  19. fi
  20. else
  21. echo "Utility to add PPA repositories in your debian machine"
  22. echo "$0 ppa:user/ppa-name"
  23. fi

五、安装常用软件

安装apt自带的包

  • normal
    sudo apt-get install apt-file aptitude remmina blender audacity smplayer vlc fcitx-rime filezilla cheese screengrab conky conky-manager cairo-dock gimp cmus qmmp sandi zeal deluge rarcrack terminator dos2unix python-mutagen dia ghex thunderbird gnome-screenshot putty* calibre kchmviewer transmission gnome-clocks translate-shell meld
  • environment
    sudo apt-get install android* androguard strace virtualbox

  • secure
    sudo apt install network-manager-openvpn-gnome libappindicator3-1 network-manager-pptp network-manager-pptp-gnome network-manager-strongswan network-manager-vpnc network-manager-vpnc-gnome telegram-desktop
  • other
    wxhexeditor

安装第三方的deb包

  1. #大体流程如下
  2. sudo dpkg -i xxx.deb
  3. # sudo apt-get install -f #如果出现依赖缺失,执行这个从源里面下载。
  4. # 如果源里面没有指定包,去debian网站上下载。为保证系统稳定,千万不要乱改自己的sources.list。

搜狗输入法

需要事先准备如下几个文件:libqt5webkit5_5.212.0_alpha2-9_amd64.deb、fcitx-libs-qt_4.2.9.1-6_all.deb、sogoupinyin_2.2.0.0102_amd64.deb

  1. > sudo apt-get install fcitx #搜狗基于fcitx,需要先装好。
  2. #如果此时直接dpkg安装sogoupinyin.deb会报依赖问题,去debian官网找到对应的依赖包,手动安装。
  3. > sudo dpkg -i libqt5webkit5_5.212.0_alpha2-9_amd64.deb
  4. (Reading database ... 520377 files and directories currently installed.)
  5. Preparing to unpack libqt5webkit5_5.212.0_alpha2-9_amd64.deb ...
  6. Unpacking libqt5webkit5:amd64 (5.212.0~alpha2-9) over (5.212.0~alpha2-9) ...
  7. dpkg: dependency problems prevent configuration of libqt5webkit5:amd64:
  8. libqt5webkit5:amd64 depends on qtbase-abi-5-10-0; however:
  9. Package qtbase-abi-5-10-0 is not installed.
  10. libqt5webkit5:amd64 depends on qtdeclarative-abi-5-10-1; however:
  11. Package qtdeclarative-abi-5-10-1 is not installed.
  12. > sudo apt-get install -f
  13. > sudo dpkg -i fcitx-libs-qt_4.2.9.1-6_all.deb
  14. > sudo dpkg -i sogoupinyin_2.2.0.0102_amd64.deb
  15. (Reading database ... 520388 files and directories currently installed.)
  16. Preparing to unpack sogoupinyin_2.2.0.0102_amd64.deb ...
  17. Unpacking sogoupinyin (2.2.0.0102) over (2.2.0.0102) ...
  18. Setting up sogoupinyin (2.2.0.0102) ...
  19. Processing triggers for mime-support (3.61) ...
  20. Processing triggers for gnome-menus (3.13.3-11) ...
  21. Processing triggers for desktop-file-utils (0.23-3) ...
  22. Processing triggers for shared-mime-info (1.9-2) ...
  23. Processing triggers for libglib2.0-0:amd64 (2.56.1-2) ...
  24. No such key 'Gtk/IMModule' in schema 'org.gnome.settings-daemon.plugins.xsettings' as specified in override file '/usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override'; ignoring override for this key.
  25. Processing triggers for hicolor-icon-theme (0.17-2) ...

安装后需要重启一次系统,然后在fcitx面板中配置输入法顺序。
如果配置好后无法启动搜狗输入法,找到搜狗输入法的这个配置文件:

  1. $ find /usr -name 50_sogoupinyin.gschema.override
  2. /usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override

查看文件内容

  1. $ cat /usr/share/glib-2.0/schemas/50_sogoupinyin.gschema.override
  2. [org.gnome.settings-daemon.plugins.keyboard]
  3. active=false
  4. [org.gnome.settings-daemon.plugins.xsettings]
  5. Gtk/IMModule=fcitx
  6. [com.canonical.indicator.keyboard]
  7. visible=false

修改成如下内容

  1. [org.gnome.settings-daemon.plugins.keyboard]
  2. active=false
  3. [org.gnome.settings-daemon.plugins.xsettings]
  4. overrides={'Gtk/IMModule':<'fcitx'>}
  5. [com.canonical.indicator.keyboard]
  6. visible=false

经过验证,从官网下载的皮肤在linux下通用。不同的是,linux版的候选字无法竖屏显示。此外,linux版的搜狗输入法没有广告、弹窗、也没有占CPU内存的sougou_cloud.exe。其实仔细想想不难发现,对搜狗来说,单单是开发linux版的输入法就已经耗费人力财力了,linux用户又不多,再开发一堆垃圾弹窗云服务实在是得不偿失。wps同理。

网易云音乐

自带源版本 sudo apt-get install netease-cloud-music
官网版本V1.1.0 ubuntu下载https://music.163.com/#/download

  1. sudo dpkg -i netease_xxx_xxx.deb
  2. sudo apt-get install -f
  3. # 执行以下命令启动:
  4. unset SESSION_MANAGER && netease-cloud-music &
  5. #可以在cairo中新建启动器,输入上面的命令。

安装后无法启动的具体原因及解决方案:
https://www.zhihu.com/question/277330447/answer/478510195

安装WPS

  1. sudo dpkg -i multiarch-support_2.19-18+deb8u10_amd64.deb #https://packages.debian.org/jessie/amd64/multiarch-support/download
  2. sudo dpkg -i libpng12-0_1.2.50-2+deb8u3_amd64.deb #https://packages.debian.org/jessie/libpng12-0
  3. sudo dpkg -i wps-office_10.1.0.5707~a21_amd64.deb #http://wps-community.org/downloads

由于版权原因,一些字体wps没有内置,初次启动时会提示部分字体缺失。github上有人整理了一份,可以从这里下载安装:https://github.com/rains31/ttf-wps-fonts

  • wingide
  1. sudo dpkg -i wingide6_6.1.0-1_amd64.deb
  2. sudo apt install libpango1.0-0
  3. sudo apt --fix-broken install

安装完成后,嘿嘿嘿……

安装tgz的包

  • 为知笔记compile/绿色版
    Ubuntu 18.04 下运行前,请先执行 sudo apt install openssl1.0 libssl1.0-dev ,再双击运行绿色版
    推荐使用 ibus 输入法
  • eclipse-adt
  • 安装python常用库

编译安装github包

以MakeHuman为例
官网:
源码:https://github.com/makehumancommunity/makehuman
贴吧:https://tieba.baidu.com/f?kw=makehuman
安装步骤:

  1. #初始化安装环境
  2. sudo apt-get install python3-numpy python3-opengl python3-pyqt5 python3-pyqt5.qtsvg #
  3. #python3-pyqt5.opengl这个包找不到,这里先略过
  4. #下载源代码
  5. git clone https://github.com/makehumancommunity/makehuman.git
  6. cd makehuman/makehuman/
  7. python3 download_assets_git.py
  8. #安装 git-lfs,参考:https://packagecloud.io/github/git-lfs/packages/ubuntu/vivid/git-lfs_2.5.1_amd64.deb
  9. # wget --content-disposition https://packagecloud.io/github/git-lfs/packages/debian/jessie/git-lfs_2.5.1_amd64.deb/download.deb
  10. # sudo dpkg -i git-lfs_2.5.1_amd64.deb
  11. # git lfs install
  12. python3 download_assets_git.py
  13. python3 compile_models.py
  14. python3 compile_proxies.py
  15. python3 compile_targets.py
  16. #启动应用
  17. ./makehuman
  18. #如果无法启动,执行如下命令
  19. # sudo apt-get install python python-numpy python-opengl python-qt4 python-qt4-gl
  20. #sudo apt-get install python-opengl python3-opengl python3-qt*
  21. #遗留问题:python3-pyqt5.opengl这个包找不到,opengl模式开启失败,但不影响基本使用。

以上注释部分为安装时遇到的依赖问题,如果遇到,就执行其中代码。

  • 安装顶部扩展插件
    用火狐打开https://extensions.gnome.org/
    命令行版:gsettings list-recursively |grep "org.gnome.shell.extensions"
  • 破解一些东东
    • webstorm系列,数据库,
      云服务器...
    • sublime http://xxx.com
    • sudo cp winewrapper.exe.so /opt/cxoffice/lib/wine/
    • wing

easyconnect配置

  • 安装前后可能遇到的问题
    • 修复add-repository
    • 开启32位架构支持 sudo dpkg --add-architecture i386
    • USB devices are not recognized in Virtualbox Linux host
      sudo adduser $USER vboxusers
    • dpkg 资源占用问题
      sudo rm /var/lib/dpkg/lock
    • 注意关机前一定要把lantern退出,不然再次开机联网会出现非常奇怪的问题.有时间写个关机监控脚本.
    • chrome更新源问题
      -apt-file search xx.so/aptitude search xxx
    1. sudo rm /etc/apt/sources.list.d/chrome-remote-desktop.list
    2. echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
    3. wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
    4. sudo apt update
    5. sudo apt upgrade
    6. #In case you still have problems with the update process, check the /etc/apt/sources.list file and remove any Google entry that may exist by executing sudo nano /etc/apt/sources.list

evil-witch-wallpaper-desktop-background-1366x768.jpg

六、参考资料

https://yq.aliyun.com/articles/233823#
https://www.ithome.com/html/it/353590.htm
https://www.linuxidc.com/Linux/2014-05/102206.htm
http://tieba.baidu.com/p/4348516267#

写作计划:打算再单独写几篇,内容包括但不限于自动化脚本,美化及优化开发环境搭建

转载于:https://www.cnblogs.com/M4K0/p/10671533.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/252082
推荐阅读
相关标签
  

闽ICP备14008679号