1, wget 'ftp: // configure
1, wget 'ftp: // ftp.archlinux.org/other/pacman/pacman-4.1.2.tar.gz' download package
2, tar xvf pacman-4.1.2.tar.gz, decompression software
3, cd pacman-4.1.2/, enter the code, execute./configure, prompt NO libarchive
4. Run sudo apt-get libarchive-dev to install libarchive.
5. Execute./configure again.
6. An error occurred while executing 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] Error 1
Make [2]: *** [all-recursive] Error 1
Make [1]: *** [all-recursive] Error 1
Make: *** [all] Error 2
--------------------------------------------------------------------------------
7, gedit lib/libalpm/be_sync.c, code file, find the code
-------------------------------------------------------------------------------
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 illegal \ n"), 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 illegal \ n"), db-> treename, pkgname );
Return-1;
}
Else if (len> PATH_MAX ){
Errno = EINVAL;
_ Alpm_log (db-> handle, ALPM_LOG_ERROR, _ ("% s database is inconsistent: filename"
"Of package % s is too long \ n"), db-> treename, pkgname );
Return-1;
}
Return 0;
}
-------------------------------------------------------------------------------
Modify as follows:
-------------------------------------------------------------------------------
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 illegal \ n"), 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 illegal \ n"), db-> treename, pkgname );
Return-1;
}
/*
Else if (len> PATH_MAX ){
Errno = EINVAL;
_ Alpm_log (db-> handle, ALPM_LOG_ERROR, _ ("% s database is inconsistent: filename"
"Of package % s is too long \ n"), db-> treename, pkgname );
Return-1;
}
*/
Return 0;
}
-------------------------------------------------------------------------------
Save and exit
7. Execute make & make install and wait until the installation is complete.
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2