我正在努力尝试更新我的 ubuntu 上的 gcc-msp430 编译器,但它不起作用(我猜是因为已经安装了同一编译器的旧版本)。这是我使用的命令以及输出。
saeid@saeid-Satellite-C660:~$ sudo dpkg --force-all -i ~/Downloads/gcc-msp430_4.6.3~mspgcc-20120406-3_i386.deb; sudo apt-get -f install
[sudo] password for saeid:
(Reading database ... 164599 files and directories currently installed.)
Unpacking gcc-msp430 (from .../gcc-msp430_4.6.3~mspgcc-20120406-3_i386.deb) ...
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/bin/msp430-cpp', which is also in package msp430-gcc-tinyos 4.5.3-20110821
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/bin/msp430-gcc', which is also in package msp430-gcc-tinyos 4.5.3-20110821
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/bin/msp430-gcov', which is also in package msp430-gcc-tinyos 4.5.3-20110821
dpkg: gcc-msp430: dependency problems, but configuring anyway as you requested:
gcc-msp430 depends on msp430mcu; however:
Package msp430mcu is not installed.
gcc-msp430 depends on binutils-msp430 (>= 2.21~); however:
Package binutils-msp430 is not installed.
Setting up gcc-msp430 (4.6.3~mspgcc-20120406-3) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
binutils-msp430 msp430mcu
Suggested packages:
msp430-libc
The following NEW packages will be installed:
binutils-msp430 msp430mcu
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/11.1 MB of archives.
After this operation, 57.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 164845 files and directories currently installed.)
Unpacking msp430mcu (from .../msp430mcu_20110613-3_all.deb) ...
dpkg: error processing /var/cache/apt/archives/msp430mcu_20110613-3_all.deb (--unpack):
trying to overwrite '/usr/msp430/lib/msp430mcu.spec', which is also in package msp430mcu-tinyos 20110613-20110821
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Unpacking binutils-msp430 (from .../binutils-msp430_2.22~msp20110716p5-1_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/binutils-msp430_2.22~msp20110716p5-1_i386.deb (--unpack):
trying to overwrite '/usr/bin/msp430-strip', which is also in package msp430-binutils-tinyos 2.21.1-20110821
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/msp430mcu_20110613-3_all.deb
/var/cache/apt/archives/binutils-msp430_2.22~msp20110716p5-1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
如果您需要更多信息,请告诉我(我现在不知道该提供什么)。
答案1
运行此命令删除旧的 gcc 编译器
sudo apt-get remove gcc*
进而
sudo dpkg --force-all -i ~/Downloads/gcc-msp430_4.6.3~mspgcc-20120406-3_i386.deb; sudo apt-get -f install
:)