Linux 学习之命令总结

本文是关于Linux学习的常用命令总结,涵盖了查看操作系统版本、代理配置、Samba重启、包管理工具apt-get和yum的使用、Node.js的介绍与安装、Java环境配置、文件拷贝scp以及解决依赖问题等实战内容。
摘要由CSDN通过智能技术生成

一下是我在学习linux的常用命令总结

 

1.查看操作系统版本 :head -n 1 /etc/issue 

2.linux 代理配置

1>/etc/profile 文件代理配置(永久生效), vi /etc/profile->   export http_proxy=http://ip:port , export https_proxy=http://ip:port->source /etc/profile(source用于刷新,使update的配置生效)

查看是否有配置代理: echo $http_proxy;echo $thhps_proxy

2>直接输入命令行(只在这次生效),

  • export http_proxy=http://10.1.1.10:8080
  •  export https_proxy=http://10.1.1.10:8080/
  • vi /etc/yum.conf and add line in the end(proxy=http://10.1.1.10:8080

3. 重启samba

  • centos: service smb start && service nmb start
  • ubuntu: sudo /etc/init.d/smbd restart

4.apt-get,是一条linux命令,适用于deb包管理式的操作系统,主要用于自动从互联网的软件仓库中搜索、安装、升级、卸载软件或操作系统

  • apt-get install packagename #安装一个新软件包
  • apt-get remove packagename #卸载一个已安装的软件包(保留配置文档)
  • apt-get remove --purge packagename #卸载一个已安装的软件包(删除配置文档)
  • apt-get autoremove packagename #删除包及其依赖的软件包
  • apt-get autoremove --purge packagname #删除包及其依赖的软件包+配置文件,比上面的要删除的彻底一点
  • dpkg --force-all --purge packagename #有些软件很难卸载,而且还阻止了别的软件的应用,就能够用这个,但是有点冒险。

apt-key,命令用于管理Debian Linux系统中的软件包密钥。每个发布的deb包&#x

从mysql官网上下载mysql-server_5.7.21-1ubuntu14.04_amd64.deb-bundle.tar,然后进行离线安装,解压该安装包,会出现11个依赖包,按照顺序依次使用sudo dpkg -i 进行安装,中间会报错,显示缺少相应的依赖,具体如下: *******@ubuntu:/opt/mysql$ sudo dpkg -i mysql-community-client_5.7.21-1ubuntu14.04_amd64.deb Selecting previously unselected package mysql-community-client. (Reading database ... 208518 files and directories currently installed.) Preparing to unpack mysql-community-client_5.7.21-1ubuntu14.04_amd64.deb ... Unpacking mysql-community-client (5.7.21-1ubuntu14.04) ... dpkg: dependency problems prevent configuration of mysql-community-client: mysql-community-client depends on libaio1 (>= 0.3.93); however: Package libaio1 is not installed. dpkg: error processing package mysql-community-client (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Errors were encountered while processing: mysql-community-client 和 ********@ubuntu:/opt/mysql$ sudo dpkg -i mysql-community-server_5.7.21-1ubuntu14.04_amd64.deb Selecting previously unselected package mysql-community-server. (Reading database ... 208598 files and directories currently installed.) Preparing to unpack mysql-community-server_5.7.21-1ubuntu14.04_amd64.deb ... Unpacking mysql-community-server (5.7.21-1ubuntu14.04) ... dpkg: dependency problems prevent configuration of mysql-community-server: mysql-community-server depends on libmecab2 (>= 0.996-1.1); however: Package libmecab2 is not installed. dpkg: error processing package mysql-community-server (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for ureadahead (0.100.0-16) ... ureadahead will be reprofiled on next reboot Errors were encountered while processing: mysql-community-server 附上依赖包安装顺序: 1.mysql-common_5.7.21-1ubuntu14.04_amd64.deb 2.libmysqlclient20_5.7.21-1ubuntu14.04_amd64.deb 3.libmysqlclient-dev_5.7.21-1ubuntu14.04_amd64.deb 4.libmysqld-dev_5.7.21-1ubuntu14.04_amd64.deb
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值