系统工程学吧 关注:5贴子:176
  • 3回复贴,共1

ubuntu下问题

只看楼主收藏回复

.在shell下执行 apt-get install build-essential
这个命令一般把gcc和g++ 什么的都装载了。
.如果还是找不到源的话把源更新了吧,默认的源是官方的,比较差劲。更新源的方法:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup (备份当前的源列表,以便日后需要时恢复)
1.sudo gedit /etc/apt/sources.list
编辑你的源列表,将原来的内容全部删除,添加下面列表中最适合你的源(注意不要全部添加),选择一个最合适你的即可,复制到你的列表中,然后保存列表。
2.sudo apt-get update 更新源列表信息
可以在运行“sudo apt-get update ”时查看一下错误信息,把不能连接的源删除再重新运行“sudo apt-get update ”。
3.sudo apt-get upgrade 升 级
推荐源列表:
ubuntu8.10的163源为:
deb http://mirrors.163.com/ubuntu/ intrepid main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ intrepid-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ intrepid-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ intrepid-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ intrepid-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ intrepid main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ intrepid-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ intrepid-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ intrepid-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ intrepid-backports main restricted universe multiverse


IP属地:广东1楼2016-08-05 21:42回复
    今天在安装软件的时候出现了Package has no installation candidate的问题,如:
    # apt-get install <packagename>
    Reading package lists... Done
    Building dependency tree... Done
    Package aptitude is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    E: Package <packagename> has no installation candidate
    解决方法如下:
    # apt-get update
    # apt-get upgrade
    # apt-get install <packagename>
    这样就可以正常使用apt-get了~
    添加第三方地址:
    sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
    sudo apt-get update


    IP属地:广东2楼2016-08-05 22:28
    回复
      1、sudo vi /etc/apt/sources.list
      2、把deb cdrom;前的##删除掉(用方向键控制光标到deb cdrom前,然后按键盘上i键,在按delete键删除##,同理也把下面的deb cdrom前的##删除,然后按Esc键,然后按住Shift键+:,输入:wq,在按Enter键)
      3、mount /dev/sr0 /media/cdrom --挂载安装Ubuntu的光盘
      4、然后键入shell命令:sudo apt-get update
      5、sudo apt-get install gcc
      6、sudo apt-get install g++


      IP属地:广东来自Android客户端3楼2016-08-05 23:56
      回复
        nohup命令
        nohup 要执行的程序 &
        例如:a.out
        nohup ./a.out &


        IP属地:广东11楼2016-08-17 22:53
        回复