今天图老师小编要跟大家分享Ubuntu安装Pacman包管理器的步骤,精心挑选的过程简单易学,喜欢的朋友一起来学习吧!
【 tulaoshi.com - Linux教程 】
Ubuntu系统操作中,Pacman是一款软件包管理器,能够对官方的Arch库和自己创建的软件包进行管理,但是有时在安装Pacman的时候会出错,下面图老师小编就给大家介绍下Ubuntu如何安装Pacman。
1,wget ‘ftp://ftp.archlinux.org/other/pacman/pacman-4.1.2.tar.gz’下载软件包
2,tar xvf pacman-4.1.2.tar.gz,解压缩软件
3,cd pacman-4.1.2/,进入代码,执行。/configure,提示没有libarchive
4,执行sudo apt-get libarchive-dev安装libarchive
5,再次执行。/configure,通过
6,执行make,出错
-------------------------------------------------------------------------------
CC libalpm_la-be_sync.lo
be_sync.c: In function ‘_alpm_validate_filename’:
be_sync.c:499: error: ‘PATH_MAX’ undeclared (first use in this function)
be_sync.c:499: error: (Each undeclared identifier is reported only once
be_sync.c:499: error: for each function it appears in.)
make[3]: *** [libalpm_la-be_sync.lo] 错误 1
make[2]: *** [all-recursive] 错误 1
make[1]: *** [all-recursive] 错误 1
make: *** [all] 错误 2
--------------------------------------------------------------------------------
7,gedit lib/libalpm/be_sync.c,代码文件,找到代码
-------------------------------------------------------------------------------
static int _alpm_validate_filename(alpm_db_t *db, const char *pkgname,
const char *filename)
{
size_t len = strlen(filename);
if(filename[0] == ‘。’) {
errno = EINVAL;
_alpm_log(db-》handle, ALPM_LOG_ERROR, _(%s database is inconsistent: filename
of package %s is illegaln), db-》treename, pkgname);
return -1;
} else if(memchr(filename, ‘/’, len) != NULL) {
errno = EINVAL;
_alpm_log(db-》handle, ALPM_LOG_ERROR, _(%s database is inconsistent: filename
of package %s is illegaln), db-》treename, pkgname);
return -1;
}
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)else if(len 》 PATH_MAX) {
errno = EINVAL;
_alpm_log(db-》handle, ALPM_LOG_ERROR, _(%s database is inconsistent: filename
of package %s is too longn), db-》treename, pkgname);
return -1;
}
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)return 0;
}
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)-------------------------------------------------------------------------------
修改如下
-------------------------------------------------------------------------------
static int _alpm_validate_filename(alpm_db_t *db, const char *pkgname,
const char *filename)
{
size_t len = strlen(filename);
if(filename[0] == ‘。’) {
errno = EINVAL;
_alpm_log(db-》handle, ALPM_LOG_ERROR, _(%s database is inconsistent: filename
of package %s is illegaln), db-》treename, pkgname);
return -1;
} else if(memchr(filename, ‘/’, len) != NULL) {
errno = EINVAL;
_alpm_log(db-》handle, ALPM_LOG_ERROR, _(%s database is inconsistent: filename
of package %s is illegaln), db-》treename, pkgname);
return -1;
}
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)/*
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)else if(len 》 PATH_MAX) {
errno = EINVAL;
_alpm_log(db-》handle, ALPM_LOG_ERROR, _(%s database is inconsistent: filename
of package %s is too longn), db-》treename, pkgname);
return -1;
}
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)*/
return 0;
}
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)-------------------------------------------------------------------------------
保存,退出
8,执行make&& make install,等待安装完成。
上面就是Ubuntu安装Pacman的方法介绍了,通常安装的时候会在执行make出错,出错后按照本文介绍的代码进行安装,最后再执行make&& make install完成安装。
来源:http://www.tulaoshi.com/n/20160219/1592396.html
看过《Ubuntu安装Pacman包管理器的步骤》的人还看了以下文章 更多>>