ubuntu gcc

dpkg或apt出现如下问题,只需要用apt重装dpkg就行

cgch@cgch-virtual-machine:~$ sudo apt-get install gcc
[sudo] password for cgch: 
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

cgch@cgch-virtual-machine:~$ sudo apt-get upgrade
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

sudo apt-get install dpkg之后,再次安装gcc的结果如下:

cgch@cgch-virtual-machine:~$ sudo apt-get install gcc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  cpp cpp-7 gcc-7 gcc-7-base gcc-8-base libasan4 libatomic1 libc-dev-bin
  libc6-dev libcc1-0 libcilkrts5 libgcc-7-dev libgcc1 libgomp1 libitm1
  liblsan0 libmpx2 libquadmath0 libstdc++6 libtsan0 libubsan0 linux-libc-dev
  manpages-dev
Suggested packages:
  cpp-doc gcc-7-locales gcc-multilib make autoconf automake libtool flex
  bison gcc-doc gcc-7-multilib gcc-7-doc libgcc1-dbg libgomp1-dbg libitm1-dbg
  libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg
  libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg glibc-doc
The following NEW packages will be installed:
  gcc gcc-7 libasan4 libatomic1 libc-dev-bin libc6-dev libcilkrts5
  libgcc-7-dev libitm1 liblsan0 libmpx2 libquadmath0 libtsan0 libubsan0
  linux-libc-dev manpages-dev
The following packages will be upgraded:
  cpp cpp-7 gcc-7-base gcc-8-base libcc1-0 libgcc1 libgomp1 libstdc++6
8 upgraded, 16 newly installed, 0 to remove and 283 not upgraded.
Need to get 23.6 MB/24.2 MB of archives.
After this operation, 73.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://10.255.253.64/files/1187000003863BD4/archive.ubuntu.com/ubuntu bionic-updates/main amd64 cpp-7 amd64 7.3.0-27ubuntu1~18.04 [6,738 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 gcc-7-base amd64 7.3.0-27ubuntu1~18.04 [18.9 kB]
……中间过程省略
Setting up gcc (4:7.3.0-3ubuntu2.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

猜你喜欢

转载自blog.csdn.net/cgch_cn/article/details/84503284