Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using Ubuntu 12.04.3 LTS, 64-bit, with gcc 4.6.3

I want to update gcc to 4.7, and do as the link said:

How do I install gcc 4.7?

But I got error:

Fetched 14.0 MB in 18s (767 kB/s)                                    
(Reading database ... 205536 files and directories currently installed.)
Preparing to replace libgcc1 1:4.6.3-1ubuntu5 (using .../libgcc1_1%3a4.8.1-2ubuntu1~12.04_amd64.deb) ...
Unpacking replacement libgcc1 ...
dpkg: error processing /var/cache/apt/archives/libgcc1_1%3a4.8.1-2ubuntu1~12.04_amd64.deb (--unpack):
 trying to overwrite '/lib/x86_64-linux-gnu/libgcc_s.so.1', which is also in package gcc-4.6 4.6.3-1ubuntu5
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

so I remove gcc 4.6:

sudo apt-get remove gcc-4.6
sudo apt-get update
apt-get: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory

Now apt-get, vi can't work any more.

share|improve this question

1 Answer 1

I copy a libgcc_s.so.1 from other computer to /lib/x86_64-linux-gnu/

Then the problem solved.

I install gcc-4.7 again, it succeed.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.