Linux系统使用中常见的问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/daaikuaichuan/article/details/89816662

1、安装某个软件时提示:现在没有可用的软件包但是它被其他软件占用了

  解决办法是更新软件源:sudo apt-get update

2、安装vim

  sudo apt-get install vim,配置文件在/etc/vim/vimrc,可修改相关配置。

3、安装搜狗输入法

  • sudo apt-get update
  • sudo apt-get install fcitx
  • 在downloads目录下,sudo dpkg -i (安装包)
  • fcitx-configtool

4、vim全局替换

  在命令行模式中输入:%s/A/B/g,把A都替换成B。

5、linux环境变量的设置

  sudo vim /etc/profile,在最后一行添加:export PATH=...:$PATH,最后source /etc/profile使其生效。

6、运行c/c++程序

gcc -o hello hello.cpp,./hello
g++ -o hello hello.cpp,./hello

7、linux中g++支持C++11的方法(在头文件中包含)

#pragma GCC diagnostic error "-std=c++11"

8、安装git

# 安装git
sudo apt-get update
sudo apt-get install git

# 设置用户名和邮箱
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

# 显示配置信息
git config --list

猜你喜欢

转载自blog.csdn.net/daaikuaichuan/article/details/89816662
今日推荐