三、在线安装软件 apt-get 举例:安装 gcc
1)查看 gcc 的版本
gcc -v
gcc --version
2)卸载 gcc
sudo apt-get remove gcc
gec@ubuntu:~$ sudo apt-get remove gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
gcc
0 upgraded, 0 newly installed, 1 to remove and 615 not upgraded.
After this operation, 45.1 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 184575 files and directories currently installed.)
Removing gcc (4:5.3.1-1ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
gec@ubuntu:~$
gec@ubuntu:~$
gec@ubuntu:~$
gec@ubuntu:~$ gcc -v
bash: /usr/bin/gcc: No such file or directory --->查询不出来说明没了
gec@ubuntu:~$
3)安装 gcc
sudo apt-get install gcc
gec@ubuntu:~$ sudo apt-get install gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
gcc-multilib autoconf automake libtool flex bison gcc-doc
The following NEW packages will be installed:
gcc
0 upgraded, 1 newly installed, 0 to remove and 615 not upgraded.
Need to get 0 B/5,244 B of archives.
After this operation, 45.1 kB of additional disk space will be used.
Selecting previously unselected package gcc.
(Reading database ... 184546 files and directories currently installed.)
Preparing to unpack .../gcc_4%3a5.3.1-1ubuntu1_amd64.deb ...
Unpacking gcc (4:5.3.1-1ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up gcc (4:5.3.1-1ubuntu1) ...
gec@ubuntu:~$
gec@ubuntu:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)
4) 练习
使用 apt-get 安装 vim
四:
如何安装离线包 如.deb后缀
实例教程:https://zhinan.sogou.com/guide/detail/?id=316513751348
安装命令:
dpkg -i xxx.deb --->i(install)
卸载命令:
dpkg -r xxx
查看安装的软件
dpkg -l
查询系统位数:
gec@ubuntu:~$ getconf LONG_BIT
64
gec@ubuntu:~$
五:
安装时注意安装包与系统位数匹配
机器位数查询命令:getconf LONG_BIT
gec@ubuntu:~$ getconf LONG_BIT
64
gec@ubuntu:~$