linux 查看u盘痕迹记录,Linux使用记录

本文来自个人博客 sunyongfeng.com。博客的文章保持更新,此文可能不是最新状态。

善用/var/log

该目录存放系统日志,很多异常,比如进不了GUI、服务器连不上等问题,都可通过此目录内的log排查。

比如samba连不上,可通过cat /var/log/auth.log | grep samba查看samba失败的原因。

服务重启

很多服务如samba、tftp如果配置文件改了之后,需要通过sudo service smbd/tftp restart来重启服务。

硬件相关

网卡相关

以Ubuntu server 14.04为例。

静态IP配置

配置文件:/etc/network/interfaces,如eth0的配置。

sunnogo@sunyongfeng:~/Downloads$ cat /etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo

iface lo inet loopback

# eth0, Realtek Fast Ethernet NIC

auto eth0

iface eth0 inet static

address 192.168.204.148

netmask 255.255.255.0

gateway 192.168.204.1

以上配置相当于命令:

ifconfig eth0 192.168.204.148 netmask 255.255.255.0

route add default gw 192.168.204.1

DNS配置

配置文件:/etc/resolvconf/resolv.conf.d/base

sunnogo@sunyongfeng:~/Downloads$ cat /etc/resolvconf/resolv.conf.d/base

nameserver 8.8.8.8

nameserver 114.114.114.114

禁用IPv6

禁用的原因:ubuntu源默认使用IPv6,详见链接。

修订文件/etc/sysctl.conf,在该文件最后加上:

# IPv6 disabled

net.ipv6.conf.all.disable_ipv6 = 1

net.ipv6.conf.default.disable_ipv6 = 1

net.ipv6.conf.lo.disable_ipv6 = 1

保存关闭,并执行

$ sudo sysctl -p

即时生效,可通过ifconfig检查。重启有效。

显示相关

屏幕分辨率问题

处理elementary OS时的操作

sudo xrandr --newmode "1440x900" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync

sudo xrandr --addmode VGA1 1440x900

sudo xrandr --output VGA1 --mode 1440x900

日常使用

apt

配置源

安装ubuntu的图形工具update-manager,通过Software & Updates,在“Ubuntu Software”标签页,点“Download from:”旁边的复选框,选择http://mirrors.yun-idc.com/ubuntu,这个源在福州的速度不错。

亦可通过更改/etc/apt/source.list的内容实现源配置。

debian可以通过apt-spy实现类似功能。

更新cache

apt-get update

以关键字查找包

apt-cache search your-keyword

强制使用IPv4更新

默认使用IPv6源更新,不过国内目前还未全力推广IPv6。通过Software & Updates图形界面配置中文源后,无此问题。

强制使用IPv4更新的方法,说明详见链接。

使用apt-get install时,加入选项 -o Acquire::ForceIPv4=true。

添加一个配置文件/etc/apt/apt.conf.d/99force-ipv4,在配置文件中写入Acquire::ForceIPv4 "true";。

安装失败

出现如下错误:

sunyongfeng@R04220 ~/smoking/ci $ sudo apt-get install npm

[sudo] password for sunyongfeng:

正在读取软件包列表... 有错误!

E: Encountered a section with no Package: header

E: Problem with MergeList /var/lib/apt/lists/packages.linuxmint.com_dists_rebecca_import_i18n_Translation-en

E: 无法解析或打开软件包的列表或是状态文件。

解决,简单粗暴地删除cache,再更新一下。

sudo rm /var/lib/apt/lists/* -vf

sudo apt-get update

中文支持

Ubuntu server 14.04中文支持

默认使用English,之后装gdm,想在英文环境中显示中文。

安装的包:

中文支持

gnome中文支持包:

language-pack-zh-han*

language-pack-gnome-zh-han*

中文字体

ttf-wqy-microhei

ttf-wqy-zenhei

ttf-ubuntu-font-family,这个不是中文字体,只是装一下而已。

fonts-arphic-uming,个人很喜欢的一个中文字体,不过其英文显示有点难看。

输入法

使用经典的fcitx。

Ubuntu server 14.04 fcitx

安装的包

fcitx

fcitx-config-gtk2,图形配置工具

fcitx-table-wbpy,五笔拼音输出法

fcitx-module-*,有dbus、kimpanel等

fcitx-frontend-*,在gdm中,不需要装这个。为fbterm准备。

配置

卸载ibus,apt-get remove ibus,5M多;原理不明。

通过fcitx-config-gtk2,点击“Input Method”标签页左下方的“+”号,搜索出WubiPinyin,添加即可。

fcitx旧安装方式记录

sudo apt-get install fcitx fcitx-frontend-qt5 fcitx-table-wbpy fcitx-ui-classic fcitx-config-gtk3

sudo apt-get remove ibus

ps -e | grep ibus, kill掉带ibus_daemon的那条进程

sudo apt-get install im-switch

in-switch -s fcitx

fcitx-table-xxx,这里用的wbpy是五笔拼音,其他输入法如拼音由使用者自己选择。

执行:fcitx-autostart可开机自启动打开fcitx。

浏览器

安装的包:(安装完后,默认的中文字体意外地显示得很好AR PL UMing CN和Monospace)

chromium-browser

pepperflashplugin-nonfree

文件管理器(File Manager)

注意与窗口管理器(Window Manager)的概念不一样。

安装包:

gnome,nautilus

kde,dolphin

文本编辑器

安装包:

gnome,gdeit

kde,kate

引导失败

一般是先装Linux再装Windows出现。解决方法:

用Docker吧,不用再装Windows了。

通过Linux USB启动盘进入U盘中的Linux,通过grub一般都能修复,然后替换掉windows的引导,先通过grub引导。

update-grub或update-grub2

grub-install

通过EasyBCD配置,重启后进入Linux,然后再进行grub修复。

键鼠

提示CapsLock键

大写提示工具:indicators-keylock,先导入源,再安装。

sudo add-apt-repository ppa:tsbarnes/indicator-keylock && sudo apt-get update

sudo apt-get install indicator-keylock

禁用触摸板

Ubuntu配置禁用触摸板wiki。

命令:synclient touchpadoff=1。

可以使用工具GPointingDeviceSettings。

用户管理

添加用户

命令:

useradd

usermod

userdel

修改密码

命令:passwd username

修改root密码

ubuntu的默认root密码随机,通过sudo passwd root修改

添加sudo用户

如果用户不是sudo用户,且使用sudo命令,则会提示“xxx is not in the sudoers file. This incident will be reported”。解决方法:

拿到root权限,添加文件/etc/sudoers读权限

修改/etc/sudoers,在User privilege specification下,类似root那样,添加一行usernamexxxx ALL=(ALL:ALL) ALL

# User privilege specification

root ALL=(ALL:ALL) ALL

usernamexxxx ALL=(ALL:ALL) ALL

配置字体

拷贝字体

配置字体

刷新字体

sudo cp -a msfonts /usr/share/fonts/msfonts

sudo fc-cache -f -v

fc-cache -f -s -v

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值