Ubuntu 常见问题

  1. txt乱码(windows下生成的文本在linux下打开)
    使用iconv解决。
    The iconv program reads in text in one encoding and outputs the text in
    another encoding. If no input files are given, or if it is given as a
    dash (-), iconv reads from standard input. If no output file is given,
    iconv writes to standard output.
    iconv [options] [-f from-encoding] [-t to-encoding] [inputfile] > [outputfile]
    iconv -f gb2312 -t utf8 [inputfile] -o [outputfile]
  2. windows下编写的Perl程序不能在Linux下运行
    使用dos2unix解决
    The Dos2unix package includes utilities "dos2unix" and "unix2dos" to
    convert plain text files in DOS or Mac format to Unix format and vice
    versa.
    In DOS/Windows text files a line break, also known as newline, is a
    combination of two characters: a Carriage Return (CR) followed by a
    Line Feed (LF). In Unix text files a line break is a single character:
    the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break
    was single Carriage Return (CR) character. Nowadays Mac OS uses Unix
    style (LF) line breaks.
    Besides line breaks Dos2unix can also convert the encoding of files. A
    few DOS code pages can be converted to Unix Latin-1. And Windows
    Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files.dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]
  3. Network service discovery disabled
    Your current network has a .local domain, which is not recommended and incompatible with the Avahi network service discovery. The service has been disabled.

    sudo vim /etc/default/avahi-daemon

    Make the parameter below from 1 to 0

    AVAHI_DAEMON_DETECT_LOCAL=0

  4. /boot空间不足:
    /boot是放置内核的地方,这时候就该删除多余的内核了。具体流程为:
    1. 确定自己使用的内核编号

    uname -a

    2. 确定自己安装过哪些内核

    sudo dpkg --get-selections | grep linux-

    3. 删除多余内核
    sudo apt-get purge 后面跟上两类文件,一类是“linux-headers”,另一类是“linux-image”,这两者是成对的。当前使用的内核不能删除。
    4. 清理deinstall (这是一条组合命令,先得到标识为deinstall的名称,再purge。)

    dpkg --purge `dpkg --get-selections | grep deinstall | cut -f 1`

    5. 更新grub

    sudo update-grub

  5. 用户A编辑文件file.txt,这时,用户B向file.txt追加输入字符,能够成功输入。不过,具体顺序,有待探究。
  6. 安装最新版的NVIDIA驱动
    20170312,尝试安装NVIDIA-Linux-x86_64-375.39.run,但是失败了,在网上发现,20170228时,有人也反映了这个问题。Ubuntu安装最新版的NVIDIA会有些问题,因为,Ubuntu跟Nvidia是两个机构,Ubuntu无法得到NVIDIA的源码,只能通过修改和调试让ubuntu兼容nvidia驱动,或者让用户使用ubuntu社区自己开发的驱动。在软件管理中心那里,有367.57版本的NVIDIA。
  7. 修改默认启动的内核
    sudo vim /etc/default/grub
    
    GRUB_DEFAULT=0
    #GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 4.10.0-041000-generic"
    
    sudo update-grub
  8. foobar

Leave a Reply

Your email address will not be published. Required fields are marked *