Debian小技巧1--常用软件服务配置方法

Debian小技巧1--常用软件服务配置方法

 

最近,由于需要开始使用debian系统了,在使用过程会碰见一些经典的配置和操作方法,因此和往常一样记录下自己操作过程,后续将持续更新、优化,一方面以便于自己查阅,另一方面分享给有需要的人学习!

 

1 娱乐办公

1.1 安装中文输入法
sudo apt update 
sudo apt install fcitx
sudo apt install fcitx-googlepinyin fcitx-pinyin  fcitx-sunpinyin
安装成功后重启机器,系统上可以看到对应输入法,也可以在搜狗上下载对应安装包,dpkg安装后apt install -f重启即可使用搜狗输入法;
后续也可以在System-》Control Center-》COther-》Fcitx Configuration中增删输入法

1.2 install skype 
download skype https://go.skype.com/skypeforlinux-64.deb
dpkg -i skypeforlinux-64.deb
apt install -f

1.3 install teamviewer
download linux teamviewer https://www.teamviewer.com/en/download/linux/
dpkg -i xxx.deb
apt install -f

1.4 网易云音乐
[云音乐下载网址](https://music.163.com/#/download)
dpkg -i netease-cloud-music_1.2.1_amd64_ubuntu_20190428.deb
注意:最新版本云音乐在debian9上启动会出现缺少插件,导致无法正常启动,但升级到debian10后可以正常启动云音乐。

1.5 安装wechat
目前鹅厂没有提供linux版本wechat,但是可使用开源版本electronic-wechat,解压后即可使用。也可以使用网页版本。
[electronic-wechat github网址](https://github.com/geeeeeeeeek/electronic-wechat)
若运行出现: error while loading shared libraries: libgconf-2.so.4,则apt install libgconf-2-4 即可解决问题。

2 专业软件

2.1 apt install simplescreenrecorder
命令行输入simplescreenrecorder就可以调出录屏程序,也可以在applications-Sound & Videos-simplescreenrecorder找到该程序

2.2 debian和windows共享文件夹
参考文献: [debian8.8访问win7共享文件夹](https://blog.csdn.net/zage2012/article/details/72575708)
# apt-get install samba 
# apt-get install smbclient
# smbclient -L //IP地址 -U 用户名,其中不带“$”的那个,就是我们可以访问的共享文件夹了,其中“-U”是用来指定查询共享权限的
使用root命令将远端目录挂在本地,即可访问:
mount -o username=xg,password=111111wm //192.168.1.3/F /home/xg/File/mnt/F/ 
umount /home/xg/File/mnt/F/ #退出共享

使用win10发现 smbclient -L //IP地址 -U 用户名,出现NT_STATUS_CONNECTTION_RESET错误,解决方法:smbclient -L //IP地址 -U 用户名 -SMB2,之后输入密码即可。
若需要取消共享文件夹密码:在Control Panel\All Control Panel Items\Network and Sharing Center\Advanced sharing settings中,Turn off password protected sharing即可。
debian先可以通过echo |smbclient -L //IP地址 -U 用户名 -SMB2 获取共享文件夹信息,而且不需要输入密码。
若出现host is down则添加vers=2.0参数
mount  //192.168.1.3/F /home/xg/File/mnt/F/  -o username=xg,password=yourPwd,vers=2.0
出现read-only则添加,sec=ntlm参数,apt install cifs-utils 
mount  //192.168.1.3/F /home/xg/File/mnt/F/  -o username=xg,password=yourPwd,vers=2.0,sec=ntlm

2.3 apt install gnome-screenshot
gnome-screenshot -a 报错:
(gnome-screenshot:3595): GLib-GIO-CRITICAL **: g_dbus_proxy_new_sync: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(gnome-screenshot:3595): GLib-GIO-CRITICAL **: g_dbus_proxy_get_name_owner: assertion 'G_IS_DBUS_PROXY (proxy)' failed
(gnome-screenshot:3595): GLib-GIO-CRITICAL **: g_dbus_connection_call_internal: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
解决方法:
使用su -或者su - usrName否则环境变量有问题,导致报错,建议使用普通用户截图
root用户截图在/root目录不建议使用root截图
普通用户截图在/home/usrName/Pictures目录
也可以通过:Applications-》Accessories-》Take a Screenshot进行截图,可以根据需要选择权窗口、当前窗口、区域抓图等3种方式。抓图命令:mate-screenshot [-a],无-a则为全屏幕抓图。

2.4  install filezilla
https://filezilla-project.org/download.php
download tar.gz, execute bin file
tools: scp rsync

/filezilla: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /home/xg/Soft/FileZilla3/bin/../lib/libgnutls.so.30)
strings /lib/x86_64-linux-gnu/libc.so.6 |grep GLIBC 发现没有glibc 2.25
#download http://ftp.gnome.org/pub/gnome/sources/glib/

#download  http://www.gnu.org/software/gettext/gettext.html
install gettext
install glib

notice:loading shared libraries: libgettextsrc-0.20.1.so: cannot open shared object file: No such file or directory
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
then,install glibc

总之依次安装即可,需要之一的是安装glib的时候,最后在虚拟机上编译确认对系统没有影响后再在实体机上编译使用,否则有可能对系统早冲永久损坏,导致很多重要服务无法启动。

debian10在apt update后,可以直接通过apt install filezilla进行安装。

2.5 debian9.11下安装nvidia显卡
debian下可以直接通过apt安装一般的显卡,若无法安装就去官方下载制定版本安装,[nvidia驱动地址](https://www.geforce.cn/drivers)。
apt install nvidia-detect
apt  install nvidia-settings
apt install nvidia-driver(若缺少相关依赖,根据提示安装即可)
atp install libgl1-nvidia-glvnd-glx (依赖1)
apt install nvidia-driver-libs (依赖2)
apt install nvidia-driver
apt install nvidia-msi (NVIDIA管理工具,查看NVIDIA显卡使用情况)
安装成功后,NVIDIA显卡状态如下:

2.6 debian9升级debian10的命令
使用下面的 sed 命令来在软件包存储库文件中使用 buster 替换 stretch(也可以直接通过3.3更换源为buster):
$ sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list
$ sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/*.list
更新源:
sudo apt update
升级:
sudo apt upgrade -y
sudo apt dist-upgrade -y
升级后通过cat /etc/os-release|issue|debian_verson 查询系统版本为:bulster 10.1

2.7 安装卸载 vmware-workstation
安装:在官网下载可执行包,安装即可;[官网地址](https://www.vmware.com/cn/products/workstation-player/workstation-player-evaluation.html)
卸载:/usr/bin/vmware-installer -u vmware-workstation

2.8 安装ffmpeg

debian 9,10
$ sudo apt-get update
$ sudo apt-get install ffmpeg

debian 8
1)add ffmpeg source
$ sudo vim /etc/apt/sources.list
Add the following lines at the end of the file:

# deb-multimedia
deb http://www.deb-multimedia.org jessie main non-free
deb-src http://www.deb-multimedia.org jessie main non-free

# jessie-backports
deb http://httpredir.debian.org/debian/ jessie-backports main
Save and close the file.

2)Update the package list and install deb-multimedia keyring:
$ sudo apt-get update
$ sudo apt-get install deb-multimedia-keyring
$ sudo apt-get update
Install FFmpeg.
$ sudo apt-get install ffmpeg
Verify the installation.
$ ffmpeg -version

参考:how-to-install-ffmpeg-on-debian-8-or-9

3 常见配置

3.1 设置快捷键
System->Control Center->Keyboard Shortcuts,根据需要设置即可,也可以根据需要添加特殊快捷键

3.2  Linux 下监控
[linux系统监控:记录用户操作轨迹,谁动过服务器](https://www.cnblogs.com/aini521521/p/9718129.html)

3.3 更新源为清华以提高下载速度
官方说明文档:https://mirror.tuna.tsinghua.edu.cn/help/debian/
Debian 镜像使用帮助,Debian 的软件源配置文件是 /etc/apt/sources.list。将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用 TUNA 的软件源镜像;若使用Ubuntu系统则对应为help/ubuntu,选中对应版本即可。
如果遇到无法拉取 https 源的情况,请先使用 http 源并安装:
$ sudo apt install apt-transport-https
再使用 TUNA 的软件源镜像。
选择你的 Debian 版本: 9.8 对应stretch版本

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free

debian 10.x 镜像的源

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

3.4 使用命令打开到特定文件夹
gnome桌面直接使用 gnome-open /path
mate桌面需要pt install nautilus,然后nautilus /path

3.5 系统默认java设置java_home
通过如下方法可以查看到系统默认java存放位置:
xg@xghost:~$ whereis java
java: /usr/bin/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gz
xg@xghost:~$ ls /usr/bin/java -ls
0 lrwxrwxrwx 1 root root 22 Sep 12 09:04 /usr/bin/java -> /etc/alternatives/java
xg@xghost:~$ ls /etc/alternatives/java -la
lrwxrwxrwx 1 root root 46 Sep 12 09:04 /etc/alternatives/java -> /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
通过/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java可以发现,实际java_home为/usr/lib/jvm/java-8-openjdk-amd64,因此设置这个路径就可以了。

3.6 debian外接显示器事宜
debian外接显示器后,默认主副屏都使用,因此需要设置外界显示器的primary级别或者关闭相应显示器,再否则讲应用拖到对应显示器区域。

3.7 debian关闭tab键bell声音
debian10默认使用tab键盘的时候,经常出现bell的响声,通过修改/etc/inputrc即可屏蔽,方法如下:
将inputrc中如下内容的注释取消掉,重启后即可小时tab键的声音。
set bell-style none

3.8 debian10解决goldenDict自动退出问题
debian9升级到10后,goldendict输入单词查询后过几秒自动退出,经过网友测试解决方法如下:
Edit-Dictionaries-Sources-Wikipedia-取消所有Wikipedia相关site选项,重启系统后查询就不退出了。

4 注意事项

4.1 不要随意自行变异更新glibc和内核,容易导致系统出现重大bug,若需要尝试应该优先在虚拟机中测试,成功后才能在本机执行;

4.2 当前测试系统为debian9.xx 桌面版

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

昕光xg

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值